Rename Article.webFeed to Article.feed.

This commit is contained in:
Brent Simmons
2023-07-02 16:22:14 -07:00
parent bb450ababa
commit 75f1eee00c
21 changed files with 47 additions and 51 deletions

View File

@@ -1217,7 +1217,7 @@ private extension Account {
// The unread number should match the feeds unread count.
let feedUnreadCount = articles.reduce(0) { (result, article) -> Int in
if article.webFeed == webFeed && !article.status.read {
if article.feed == webFeed && !article.status.read {
return result + 1
}
return result
@@ -1281,7 +1281,7 @@ private extension Account {
}
func noteStatusesForArticlesDidChange(_ articles: Set<Article>) {
let feeds = Set(articles.compactMap { $0.webFeed })
let feeds = Set(articles.compactMap { $0.feed })
let statuses = Set(articles.map { $0.status })
let articleIDs = Set(articles.map { $0.articleID })
@@ -1372,10 +1372,10 @@ private extension Account {
var webFeeds = Set<WebFeed>()
if let newArticles = articleChanges.newArticles {
webFeeds.formUnion(Set(newArticles.compactMap { $0.webFeed }))
webFeeds.formUnion(Set(newArticles.compactMap { $0.feed }))
}
if let updatedArticles = articleChanges.updatedArticles {
webFeeds.formUnion(Set(updatedArticles.compactMap { $0.webFeed }))
webFeeds.formUnion(Set(updatedArticles.compactMap { $0.feed }))
}
var shouldSendNotification = false

View File

@@ -166,7 +166,7 @@ private extension CloudKitArticlesZone {
func makeStatusRecord(_ article: Article) -> CKRecord {
let recordID = CKRecord.ID(recordName: statusID(article.articleID), zoneID: zoneID)
let record = CKRecord(recordType: CloudKitArticleStatus.recordType, recordID: recordID)
if let webFeedExternalID = article.webFeed?.externalID {
if let webFeedExternalID = article.feed?.externalID {
record[CloudKitArticleStatus.Fields.webFeedExternalID] = webFeedExternalID
}
record[CloudKitArticleStatus.Fields.read] = article.status.read ? "1" : "0"
@@ -178,7 +178,7 @@ private extension CloudKitArticlesZone {
let recordID = CKRecord.ID(recordName: statusID(statusUpdate.articleID), zoneID: zoneID)
let record = CKRecord(recordType: CloudKitArticleStatus.recordType, recordID: recordID)
if let webFeedExternalID = statusUpdate.article?.webFeed?.externalID {
if let webFeedExternalID = statusUpdate.article?.feed?.externalID {
record[CloudKitArticleStatus.Fields.webFeedExternalID] = webFeedExternalID
}
@@ -194,7 +194,7 @@ private extension CloudKitArticlesZone {
let articleStatusRecordID = CKRecord.ID(recordName: statusID(article.articleID), zoneID: zoneID)
record[CloudKitArticle.Fields.articleStatus] = CKRecord.Reference(recordID: articleStatusRecordID, action: .deleteSelf)
record[CloudKitArticle.Fields.webFeedURL] = article.webFeed?.url
record[CloudKitArticle.Fields.webFeedURL] = article.feed?.url
record[CloudKitArticle.Fields.uniqueID] = article.uniqueID
record[CloudKitArticle.Fields.title] = article.title
record[CloudKitArticle.Fields.contentHTML] = article.contentHTML

View File

@@ -56,7 +56,7 @@ public extension Article {
return manager.existingAccount(with: accountID)
}
var webFeed: WebFeed? {
var feed: WebFeed? {
return account?.existingWebFeed(withWebFeedID: webFeedID)
}
}