mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Continue renaming webFeed to feed.
This commit is contained in:
@@ -235,7 +235,7 @@ private extension ActivityManager {
|
||||
#endif
|
||||
|
||||
func makeKeywords(_ article: Article) -> [String] {
|
||||
let feedNameKeywords = makeKeywords(article.webFeed?.nameForDisplay)
|
||||
let feedNameKeywords = makeKeywords(article.feed?.nameForDisplay)
|
||||
let articleTitleKeywords = makeKeywords(ArticleStringFormatter.truncatedTitle(article))
|
||||
return feedNameKeywords + articleTitleKeywords
|
||||
}
|
||||
|
||||
@@ -241,8 +241,8 @@ private extension ArticleRenderer {
|
||||
d["dateline_style"] = "articleDateline"
|
||||
}
|
||||
|
||||
d["feed_link_title"] = article.webFeed?.nameForDisplay ?? ""
|
||||
d["feed_link"] = article.webFeed?.homePageURL ?? ""
|
||||
d["feed_link_title"] = article.feed?.nameForDisplay ?? ""
|
||||
d["feed_link"] = article.feed?.homePageURL ?? ""
|
||||
|
||||
d["byline"] = byline()
|
||||
|
||||
@@ -261,7 +261,7 @@ private extension ArticleRenderer {
|
||||
}
|
||||
|
||||
func byline() -> String {
|
||||
guard let authors = article?.authors ?? article?.webFeed?.authors, !authors.isEmpty else {
|
||||
guard let authors = article?.authors ?? article?.feed?.authors, !authors.isEmpty else {
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ private extension ArticleRenderer {
|
||||
// This code assumes that multiple authors would never match the feed name so that
|
||||
// if there feed owner has an article co-author all authors are given the byline.
|
||||
if authors.count == 1, let author = authors.first {
|
||||
if author.name == article?.webFeed?.nameForDisplay {
|
||||
if author.name == article?.feed?.nameForDisplay {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
@@ -333,10 +333,10 @@ private extension Article {
|
||||
var baseURL: URL? {
|
||||
var s = link
|
||||
if s == nil {
|
||||
s = webFeed?.homePageURL
|
||||
s = feed?.homePageURL
|
||||
}
|
||||
if s == nil {
|
||||
s = webFeed?.url
|
||||
s = feed?.url
|
||||
}
|
||||
|
||||
guard let urlString = s else {
|
||||
|
||||
@@ -50,7 +50,7 @@ private extension SendToMarsEditCommand {
|
||||
let body = article.contentHTML ?? article.contentText ?? article.summary
|
||||
let authorName = article.authors?.first?.name
|
||||
|
||||
let sender = SendToBlogEditorApp(targetDescriptor: targetDescriptor, title: article.title, body: body, summary: article.summary, link: article.externalLink, permalink: article.link, subject: nil, creator: authorName, commentsURL: nil, guid: article.uniqueID, sourceName: article.webFeed?.nameForDisplay, sourceHomeURL: article.webFeed?.homePageURL, sourceFeedURL: article.webFeed?.url)
|
||||
let sender = SendToBlogEditorApp(targetDescriptor: targetDescriptor, title: article.title, body: body, summary: article.summary, link: article.externalLink, permalink: article.link, subject: nil, creator: authorName, commentsURL: nil, guid: article.uniqueID, sourceName: article.feed?.nameForDisplay, sourceHomeURL: article.feed?.homePageURL, sourceFeedURL: article.feed?.url)
|
||||
let _ = sender.send()
|
||||
}
|
||||
|
||||
|
||||
@@ -65,10 +65,10 @@ private extension Article {
|
||||
// Feed name, or feed name + author name (if author is specified per-article).
|
||||
// Includes trailing space.
|
||||
|
||||
if let feedName = webFeed?.nameForDisplay, let authorName = authors?.first?.name {
|
||||
if let feedName = feed?.nameForDisplay, let authorName = authors?.first?.name {
|
||||
return feedName + ", " + authorName + ": "
|
||||
}
|
||||
if let feedName = webFeed?.nameForDisplay {
|
||||
if let feedName = feed?.nameForDisplay {
|
||||
return feedName + ": "
|
||||
}
|
||||
return ""
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
import Foundation
|
||||
import Account
|
||||
|
||||
struct AddWebFeedDefaultContainer {
|
||||
struct AddFeedDefaultContainer {
|
||||
|
||||
static var defaultContainer: Container? {
|
||||
|
||||
if let accountID = AppDefaults.shared.addWebFeedAccountID, let account = AccountManager.shared.activeAccounts.first(where: { $0.accountID == accountID }) {
|
||||
if let folderName = AppDefaults.shared.addWebFeedFolderName, let folder = account.existingFolder(withDisplayName: folderName) {
|
||||
if let accountID = AppDefaults.shared.addFeedAccountID, let account = AccountManager.shared.activeAccounts.first(where: { $0.accountID == accountID }) {
|
||||
if let folderName = AppDefaults.shared.addFeedFolderName, let folder = account.existingFolder(withDisplayName: folderName) {
|
||||
return folder
|
||||
} else {
|
||||
return substituteContainerIfNeeded(account: account)
|
||||
@@ -28,11 +28,11 @@ struct AddWebFeedDefaultContainer {
|
||||
}
|
||||
|
||||
static func saveDefaultContainer(_ container: Container) {
|
||||
AppDefaults.shared.addWebFeedAccountID = container.account?.accountID
|
||||
AppDefaults.shared.addFeedAccountID = container.account?.accountID
|
||||
if let folder = container as? Folder {
|
||||
AppDefaults.shared.addWebFeedFolderName = folder.nameForDisplay
|
||||
AppDefaults.shared.addFeedFolderName = folder.nameForDisplay
|
||||
} else {
|
||||
AppDefaults.shared.addWebFeedFolderName = nil
|
||||
AppDefaults.shared.addFeedFolderName = nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ private func accountAndArticlesDictionary(_ articles: Set<Article>) -> [String:
|
||||
|
||||
extension Article {
|
||||
|
||||
var webFeed: Feed? {
|
||||
var feed: Feed? {
|
||||
return account?.existingWebFeed(withWebFeedID: webFeedID)
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ extension Article {
|
||||
}
|
||||
|
||||
func byline() -> String {
|
||||
guard let authors = authors ?? webFeed?.authors, !authors.isEmpty else {
|
||||
guard let authors = authors ?? feed?.authors, !authors.isEmpty else {
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ extension Article {
|
||||
// This code assumes that multiple authors would never match the feed name so that
|
||||
// if there feed owner has an article co-author all authors are given the byline.
|
||||
if authors.count == 1, let author = authors.first {
|
||||
if author.name == webFeed?.nameForDisplay {
|
||||
if author.name == feed?.nameForDisplay {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
@@ -215,7 +215,7 @@ extension Article {
|
||||
extension Article: SortableArticle {
|
||||
|
||||
var sortableName: String {
|
||||
return webFeed?.name ?? ""
|
||||
return feed?.name ?? ""
|
||||
}
|
||||
|
||||
var sortableDate: Date {
|
||||
|
||||
@@ -52,7 +52,7 @@ class IconImageCache {
|
||||
if let iconImage = imageForAuthors(article.authors) {
|
||||
return iconImage
|
||||
}
|
||||
guard let feed = article.webFeed else {
|
||||
guard let feed = article.feed else {
|
||||
return nil
|
||||
}
|
||||
return imageForFeed(feed)
|
||||
|
||||
@@ -12,8 +12,8 @@ struct ShareDefaultContainer {
|
||||
|
||||
static func defaultContainer(containers: ExtensionContainers) -> ExtensionContainer? {
|
||||
|
||||
if let accountID = AppDefaults.shared.addWebFeedAccountID, let account = containers.accounts.first(where: { $0.accountID == accountID }) {
|
||||
if let folderName = AppDefaults.shared.addWebFeedFolderName, let folder = account.folders.first(where: { $0.name == folderName }) {
|
||||
if let accountID = AppDefaults.shared.addFeedAccountID, let account = containers.accounts.first(where: { $0.accountID == accountID }) {
|
||||
if let folderName = AppDefaults.shared.addFeedFolderName, let folder = account.folders.first(where: { $0.name == folderName }) {
|
||||
return folder
|
||||
} else {
|
||||
return substituteContainerIfNeeded(account: account)
|
||||
@@ -27,11 +27,11 @@ struct ShareDefaultContainer {
|
||||
}
|
||||
|
||||
static func saveDefaultContainer(_ container: ExtensionContainer) {
|
||||
AppDefaults.shared.addWebFeedAccountID = container.accountID
|
||||
AppDefaults.shared.addFeedAccountID = container.accountID
|
||||
if let folder = container as? ExtensionFolder {
|
||||
AppDefaults.shared.addWebFeedFolderName = folder.name
|
||||
AppDefaults.shared.addFeedFolderName = folder.name
|
||||
} else {
|
||||
AppDefaults.shared.addWebFeedFolderName = nil
|
||||
AppDefaults.shared.addFeedFolderName = nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ final class UserNotificationManager: NSObject {
|
||||
}
|
||||
|
||||
for article in articles {
|
||||
if !article.status.read, let webFeed = article.webFeed, webFeed.isNotifyAboutNewArticles ?? false {
|
||||
if !article.status.read, let webFeed = article.feed, webFeed.isNotifyAboutNewArticles ?? false {
|
||||
sendNotification(webFeed: webFeed, article: article)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user