diff --git a/Mac/MainWindow/Sidebar/PasteboardFeed.swift b/Mac/MainWindow/Sidebar/PasteboardFeed.swift index 1cf6025a9..d8a1735d2 100644 --- a/Mac/MainWindow/Sidebar/PasteboardFeed.swift +++ b/Mac/MainWindow/Sidebar/PasteboardFeed.swift @@ -205,7 +205,7 @@ extension Feed: @retroactive PasteboardWriterOwner { private extension FeedPasteboardWriter { var pasteboardFeed: PasteboardFeed { - return PasteboardFeed(url: feed.url, feedID: feed.webFeedID, homePageURL: feed.homePageURL, name: feed.name, editedName: feed.editedName, accountID: feed.account?.accountID, accountType: feed.account?.type) + return PasteboardFeed(url: feed.url, feedID: feed.feedID, homePageURL: feed.homePageURL, name: feed.name, editedName: feed.editedName, accountID: feed.account?.accountID, accountType: feed.account?.type) } var exportDictionary: PasteboardFeedDictionary { diff --git a/Mac/MainWindow/Sidebar/SidebarViewController.swift b/Mac/MainWindow/Sidebar/SidebarViewController.swift index 9ffd5f57e..ef3b77a1f 100644 --- a/Mac/MainWindow/Sidebar/SidebarViewController.swift +++ b/Mac/MainWindow/Sidebar/SidebarViewController.swift @@ -578,7 +578,7 @@ private extension SidebarViewController { treeControllerDelegate.addFilterException(sidebarItemID) } } else if let feed = sidebarItem as? Feed { - if feed.account?.existingFeed(withFeedID: feed.webFeedID) != nil { + if feed.account?.existingFeed(withFeedID: feed.feedID) != nil { treeControllerDelegate.addFilterException(sidebarItemID) addParentFolderToFilterExceptions(feed) } @@ -778,7 +778,7 @@ private extension SidebarViewController { guard let webFeedID = userInfo?[ArticlePathKey.feedID] as? String else { return nil } - if let node = startingNode.descendantNode(where: { ($0.representedObject as? Feed)?.webFeedID == webFeedID }) { + if let node = startingNode.descendantNode(where: { ($0.representedObject as? Feed)?.feedID == webFeedID }) { return node } return nil diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift index 428234964..8ef8377d3 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController.swift @@ -1278,14 +1278,14 @@ private extension TimelineViewController { for representedObject in representedObjects { if let feed = representedObject as? Feed { for oneFeed in webFeeds { - if feed.webFeedID == oneFeed.webFeedID || feed.url == oneFeed.url { + if feed.feedID == oneFeed.feedID || feed.url == oneFeed.url { return true } } } else if let folder = representedObject as? Folder { for oneFeed in webFeeds { - if folder.hasFeed(with: oneFeed.webFeedID) || folder.hasFeed(withURL: oneFeed.url) { + if folder.hasFeed(with: oneFeed.feedID) || folder.hasFeed(withURL: oneFeed.url) { return true } } diff --git a/Mac/Scriptability/NSApplication+Scriptability.swift b/Mac/Scriptability/NSApplication+Scriptability.swift index 915d804a3..3662be7a2 100644 --- a/Mac/Scriptability/NSApplication+Scriptability.swift +++ b/Mac/Scriptability/NSApplication+Scriptability.swift @@ -134,7 +134,7 @@ extension NSApplication : ScriptingObjectContainer { @objc(valueInWebFeedsWithUniqueID:) func valueInWebFeeds(withUniqueID id:String) -> ScriptableWebFeed? { let webFeeds = self.allWebFeeds() - guard let webFeed = webFeeds.first(where:{$0.webFeedID == id}) else { return nil } + guard let webFeed = webFeeds.first(where:{$0.feedID == id}) else { return nil } return ScriptableWebFeed(webFeed, container:self) } } diff --git a/Mac/Scriptability/WebFeed+Scriptability.swift b/Mac/Scriptability/WebFeed+Scriptability.swift index 348eb03a5..70abb2859 100644 --- a/Mac/Scriptability/WebFeed+Scriptability.swift +++ b/Mac/Scriptability/WebFeed+Scriptability.swift @@ -45,7 +45,7 @@ final class ScriptableWebFeed: NSObject, UniqueIdScriptingObject, ScriptingObjec // but in either case it seems like the accountID would be used as the keydata, so I chose ID @objc(uniqueId) var scriptingUniqueId:Any { - return webFeed.webFeedID + return webFeed.feedID } // MARK: --- ScriptingObjectContainer protocol --- diff --git a/Modules/Account/Sources/Account/Account.swift b/Modules/Account/Sources/Account/Account.swift index 8f73a8999..fbc79c368 100644 --- a/Modules/Account/Sources/Account/Account.swift +++ b/Modules/Account/Sources/Account/Account.swift @@ -701,11 +701,11 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, } public func unreadCount(for webFeed: Feed) -> Int { - return unreadCounts[webFeed.webFeedID] ?? 0 + return unreadCounts[webFeed.feedID] ?? 0 } public func setUnreadCount(_ unreadCount: Int, for webFeed: Feed) { - unreadCounts[webFeed.webFeedID] = unreadCount + unreadCounts[webFeed.feedID] = unreadCount } public func structureDidChange() { @@ -741,7 +741,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, return } - update(webFeed.webFeedID, with: parsedItems, completion: completion) + update(webFeed.feedID, with: parsedItems, completion: completion) } func update(_ webFeedID: String, with parsedItems: Set, deleteOlder: Bool = true, completion: @escaping UpdateArticlesCompletionBlock) { @@ -1059,13 +1059,13 @@ private extension Account { } func fetchArticles(feed: Feed) throws -> Set
{ - let articles = try database.fetchArticles(feed.webFeedID) + let articles = try database.fetchArticles(feed.feedID) validateUnreadCount(feed, articles) return articles } func fetchArticlesAsync(feed: Feed, _ completion: @escaping ArticleSetResultBlock) { - database.fetchArticlesAsync(feed.webFeedID) { [weak self] articleSetResult in + database.fetchArticlesAsync(feed.feedID) { [weak self] articleSetResult in switch articleSetResult { case .success(let articles): self?.validateUnreadCount(feed, articles) @@ -1101,7 +1101,7 @@ private extension Account { } func fetchUnreadArticles(webFeed: Feed) throws -> Set
{ - let articles = try database.fetchUnreadArticles(Set([webFeed.webFeedID]), nil) + let articles = try database.fetchUnreadArticles(Set([webFeed.feedID]), nil) validateUnreadCount(webFeed, articles) return articles } @@ -1169,7 +1169,7 @@ private extension Account { unreadCountStorage[article.feedID, default: 0] += 1 } webFeeds.forEach { (webFeed) in - let unreadCount = unreadCountStorage[webFeed.webFeedID, default: 0] + let unreadCount = unreadCountStorage[webFeed.feedID, default: 0] webFeed.unreadCount = unreadCount } } @@ -1220,7 +1220,7 @@ private extension Account { var externalIDDictionary = [String: Feed]() flattenedFeeds().forEach { (feed) in - idDictionary[feed.webFeedID] = feed + idDictionary[feed.feedID] = feed if let externalID = feed.externalID { externalIDDictionary[externalID] = feed } @@ -1284,7 +1284,7 @@ private extension Account { } func fetchUnreadCount(_ feed: Feed, _ completion: VoidCompletionBlock?) { - database.fetchUnreadCount(feed.webFeedID) { result in + database.fetchUnreadCount(feed.feedID) { result in if let unreadCount = try? result.get() { feed.unreadCount = unreadCount } @@ -1293,7 +1293,7 @@ private extension Account { } func fetchUnreadCounts(_ feeds: Set, _ completion: VoidCompletionBlock?) { - let webFeedIDs = Set(feeds.map { $0.webFeedID }) + let webFeedIDs = Set(feeds.map { $0.feedID }) database.fetchUnreadCounts(for: webFeedIDs) { result in if let unreadCountDictionary = try? result.get() { self.processUnreadCounts(unreadCountDictionary: unreadCountDictionary, feeds: feeds) @@ -1325,7 +1325,7 @@ private extension Account { func processUnreadCounts(unreadCountDictionary: UnreadCountDictionary, feeds: Set) { for feed in feeds { // When the unread count is zero, it won’t appear in unreadCountDictionary. - let unreadCount = unreadCountDictionary[feed.webFeedID] ?? 0 + let unreadCount = unreadCountDictionary[feed.feedID] ?? 0 feed.unreadCount = unreadCount } } diff --git a/Modules/Account/Sources/Account/Container.swift b/Modules/Account/Sources/Account/Container.swift index 3ffe1ea32..a5d1714db 100644 --- a/Modules/Account/Sources/Account/Container.swift +++ b/Modules/Account/Sources/Account/Container.swift @@ -103,7 +103,7 @@ public extension Container { func existingFeed(withFeedID feedID: String) -> Feed? { for feed in flattenedFeeds() { - if feed.webFeedID == feedID { + if feed.feedID == feedID { return feed } } diff --git a/Modules/Account/Sources/Account/Feed.swift b/Modules/Account/Sources/Account/Feed.swift index 6224c87be..2bd8f6598 100644 --- a/Modules/Account/Sources/Account/Feed.swift +++ b/Modules/Account/Sources/Account/Feed.swift @@ -22,13 +22,13 @@ public final class Feed: SidebarItem, Renamable, Hashable { assertionFailure("Expected feed.account, but got nil.") return nil } - return SidebarItemIdentifier.webFeed(accountID, webFeedID) + return SidebarItemIdentifier.webFeed(accountID, feedID) } public weak var account: Account? public let url: String - public var webFeedID: String { + public var feedID: String { get { return metadata.feedID } @@ -282,13 +282,13 @@ public final class Feed: SidebarItem, Renamable, Hashable { // MARK: - Hashable public func hash(into hasher: inout Hasher) { - hasher.combine(webFeedID) + hasher.combine(feedID) } // MARK: - Equatable public class func ==(lhs: Feed, rhs: Feed) -> Bool { - return lhs.webFeedID == rhs.webFeedID && lhs.accountID == rhs.accountID + return lhs.feedID == rhs.feedID && lhs.accountID == rhs.accountID } } @@ -325,7 +325,7 @@ extension Feed: OPMLRepresentable { extension Set where Element == Feed { func feedIDs() -> Set { - return Set(map { $0.webFeedID }) + return Set(map { $0.feedID }) } func sorted() -> Array { diff --git a/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift b/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift index 9c093bb1a..e1b4c4073 100644 --- a/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift +++ b/Modules/Account/Sources/Account/Feedbin/FeedbinAccountDelegate.swift @@ -473,7 +473,7 @@ final class FeedbinAccountDelegate: AccountDelegate { func addFeed(for account: Account, with feed: Feed, to container: Container, completion: @escaping (Result) -> Void) { - if let folder = container as? Folder, let webFeedID = Int(feed.webFeedID) { + if let folder = container as? Folder, let webFeedID = Int(feed.feedID) { refreshProgress.addToNumberOfTasksAndRemaining(1) caller.createTagging(webFeedID: webFeedID, name: folder.name ?? "") { result in self.refreshProgress.completeTask() @@ -820,7 +820,7 @@ private extension FeedbinAccountDelegate { if let folders = account.folders { for folder in folders { for feed in folder.topLevelFeeds { - if !subFeedIds.contains(feed.webFeedID) { + if !subFeedIds.contains(feed.feedID) { folder.removeFeed(feed) } } @@ -828,7 +828,7 @@ private extension FeedbinAccountDelegate { } for feed in account.topLevelFeeds { - if !subFeedIds.contains(feed.webFeedID) { + if !subFeedIds.contains(feed.feedID) { account.removeFeed(feed) } } @@ -890,7 +890,7 @@ private extension FeedbinAccountDelegate { // Move any feeds not in the folder to the account for feed in folder.topLevelFeeds { - if !taggingFeedIDs.contains(feed.webFeedID) { + if !taggingFeedIDs.contains(feed.feedID) { folder.removeFeed(feed) clearFolderRelationship(for: feed, withFolderName: folder.name ?? "") account.addFeed(feed) @@ -898,7 +898,7 @@ private extension FeedbinAccountDelegate { } // Add any feeds not in the folder - let folderFeedIds = folder.topLevelFeeds.map { $0.webFeedID } + let folderFeedIds = folder.topLevelFeeds.map { $0.feedID } for tagging in groupedTaggings { let taggingFeedID = String(tagging.feedID) @@ -917,7 +917,7 @@ private extension FeedbinAccountDelegate { // Remove all feeds from the account container that have a tag for feed in account.topLevelFeeds { - if taggedFeedIDs.contains(feed.webFeedID) { + if taggedFeedIDs.contains(feed.feedID) { account.removeFeed(feed) } } @@ -1066,7 +1066,7 @@ private extension FeedbinAccountDelegate { refreshProgress.addToNumberOfTasksAndRemaining(4) // Download the initial articles - self.caller.retrieveEntries(feedID: feed.webFeedID) { result in + self.caller.retrieveEntries(feedID: feed.feedID) { result in self.refreshProgress.completeTask() switch result { diff --git a/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift b/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift index 7bf64233f..360fd2238 100644 --- a/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift +++ b/Modules/Account/Sources/Account/Feedly/FeedlyAccountDelegate.swift @@ -359,7 +359,7 @@ final class FeedlyAccountDelegate: AccountDelegate { return } - let feedId = FeedlyFeedResourceId(id: feed.webFeedID) + let feedId = FeedlyFeedResourceId(id: feed.feedID) let editedNameBefore = feed.editedName // Adding an existing feed updates it. @@ -386,7 +386,7 @@ final class FeedlyAccountDelegate: AccountDelegate { throw FeedlyAccountDelegateError.notLoggedIn } - let resource = FeedlyFeedResourceId(id: feed.webFeedID) + let resource = FeedlyFeedResourceId(id: feed.feedID) let addExistingFeed = try FeedlyAddExistingFeedOperation(account: account, credentials: credentials, resource: resource, @@ -416,7 +416,7 @@ final class FeedlyAccountDelegate: AccountDelegate { } } - caller.removeFeed(feed.webFeedID, fromCollectionWith: collectionId) { result in + caller.removeFeed(feed.feedID, fromCollectionWith: collectionId) { result in switch result { case .success: completion(.success(())) diff --git a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyCreateFeedsForCollectionFoldersOperation.swift b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyCreateFeedsForCollectionFoldersOperation.swift index 931499ce8..bce1d5214 100644 --- a/Modules/Account/Sources/Account/Feedly/Operations/FeedlyCreateFeedsForCollectionFoldersOperation.swift +++ b/Modules/Account/Sources/Account/Feedly/Operations/FeedlyCreateFeedsForCollectionFoldersOperation.swift @@ -35,7 +35,7 @@ final class FeedlyCreateFeedsForCollectionFoldersOperation: FeedlyOperation { for (collectionFeeds, folder) in pairs { let feedsInFolder = folder.topLevelFeeds let feedsInCollection = Set(collectionFeeds.map { $0.id }) - let feedsToRemove = feedsInFolder.filter { !feedsInCollection.contains($0.webFeedID) } + let feedsToRemove = feedsInFolder.filter { !feedsInCollection.contains($0.feedID) } if !feedsToRemove.isEmpty { folder.removeFeeds(feedsToRemove) // os_log(.debug, log: log, "\"%@\" - removed: %@", collection.label, feedsToRemove.map { $0.feedID }, feedsInCollection) @@ -74,7 +74,7 @@ final class FeedlyCreateFeedsForCollectionFoldersOperation: FeedlyOperation { return (feed, folder) } else { // find an existing feed we created below in an earlier value - for feed in feedsAdded where feed.webFeedID == collectionFeed.id { + for feed in feedsAdded where feed.feedID == collectionFeed.id { return (feed, folder) } } diff --git a/Modules/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift b/Modules/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift index ce895f65f..43d98edbb 100644 --- a/Modules/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift +++ b/Modules/Account/Sources/Account/NewsBlur/Internals/NewsBlurAccountDelegate+Internal.swift @@ -85,7 +85,7 @@ extension NewsBlurAccountDelegate { if let folders = account.folders { for folder in folders { for feed in folder.topLevelFeeds { - if !newsBlurFeedIds.contains(feed.webFeedID) { + if !newsBlurFeedIds.contains(feed.feedID) { folder.removeFeed(feed) } } @@ -93,7 +93,7 @@ extension NewsBlurAccountDelegate { } for feed in account.topLevelFeeds { - if !newsBlurFeedIds.contains(feed.webFeedID) { + if !newsBlurFeedIds.contains(feed.feedID) { account.removeFeed(feed) } } @@ -156,7 +156,7 @@ extension NewsBlurAccountDelegate { // Move any feeds not in the folder to the account for feed in folder.topLevelFeeds { - if !newsBlurFolderFeedIDs.contains(feed.webFeedID) { + if !newsBlurFolderFeedIDs.contains(feed.feedID) { folder.removeFeed(feed) clearFolderRelationship(for: feed, withFolderName: folder.name ?? "") account.addFeed(feed) @@ -164,7 +164,7 @@ extension NewsBlurAccountDelegate { } // Add any feeds not in the folder - let folderFeedIds = folder.topLevelFeeds.map { $0.webFeedID } + let folderFeedIds = folder.topLevelFeeds.map { $0.feedID } for relationship in folderRelationships { let folderFeedID = String(relationship.feedID) @@ -183,7 +183,7 @@ extension NewsBlurAccountDelegate { if let folderRelationships = newsBlurFolderDict[" "] { let newsBlurFolderFeedIDs = folderRelationships.map { String($0.feedID) } for feed in account.topLevelFeeds { - if !newsBlurFolderFeedIDs.contains(feed.webFeedID) { + if !newsBlurFolderFeedIDs.contains(feed.feedID) { account.removeFeed(feed) } } @@ -448,7 +448,7 @@ extension NewsBlurAccountDelegate { func downloadFeed(account: Account, feed: Feed, page: Int, completion: @escaping (Result) -> Void) { refreshProgress.addToNumberOfTasksAndRemaining(1) - caller.retrieveStories(feedID: feed.webFeedID, page: page) { result in + caller.retrieveStories(feedID: feed.feedID, page: page) { result in switch result { case .success((let stories, _)): // No more stories @@ -529,7 +529,7 @@ extension NewsBlurAccountDelegate { switch result { case .success: DispatchQueue.main.async { - let feedID = feed.webFeedID + let feedID = feed.feedID if folderName == nil { account.removeFeed(feed) diff --git a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift index d3ce61048..f4e75098d 100644 --- a/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift +++ b/Modules/Account/Sources/Account/ReaderAPI/ReaderAPIAccountDelegate.swift @@ -756,7 +756,7 @@ private extension ReaderAPIAccountDelegate { if let folders = account.folders { for folder in folders { for feed in folder.topLevelFeeds { - if !subFeedIds.contains(feed.webFeedID) { + if !subFeedIds.contains(feed.feedID) { folder.removeFeed(feed) } } @@ -764,7 +764,7 @@ private extension ReaderAPIAccountDelegate { } for feed in account.topLevelFeeds { - if !subFeedIds.contains(feed.webFeedID) { + if !subFeedIds.contains(feed.feedID) { account.clearFeedMetadata(feed) account.removeFeed(feed) } @@ -816,7 +816,7 @@ private extension ReaderAPIAccountDelegate { // Move any feeds not in the folder to the account for feed in folder.topLevelFeeds { - if !taggingFeedIDs.contains(feed.webFeedID) { + if !taggingFeedIDs.contains(feed.feedID) { folder.removeFeed(feed) clearFolderRelationship(for: feed, folderExternalID: folder.externalID) account.addFeed(feed) @@ -824,7 +824,7 @@ private extension ReaderAPIAccountDelegate { } // Add any feeds not in the folder - let folderFeedIds = folder.topLevelFeeds.map { $0.webFeedID } + let folderFeedIds = folder.topLevelFeeds.map { $0.feedID } for subscription in groupedTaggings { let taggingFeedID = subscription.feedID @@ -843,7 +843,7 @@ private extension ReaderAPIAccountDelegate { // Remove all feeds from the account container that have a tag for feed in account.topLevelFeeds { - if taggedFeedIDs.contains(feed.webFeedID) { + if taggedFeedIDs.contains(feed.feedID) { account.removeFeed(feed) } } @@ -949,7 +949,7 @@ private extension ReaderAPIAccountDelegate { refreshProgress.addToNumberOfTasksAndRemaining(5) // Download the initial articles - self.caller.retrieveItemIDs(type: .allForFeed, webFeedID: feed.webFeedID) { result in + self.caller.retrieveItemIDs(type: .allForFeed, webFeedID: feed.feedID) { result in self.refreshProgress.completeTask() switch result { case .success(let articleIDs): diff --git a/Modules/Account/Tests/AccountTests/Feedly/FeedlyCreateFeedsForCollectionFoldersOperationTests.swift b/Modules/Account/Tests/AccountTests/Feedly/FeedlyCreateFeedsForCollectionFoldersOperationTests.swift index ea7e5fac7..8c82270bf 100644 --- a/Modules/Account/Tests/AccountTests/Feedly/FeedlyCreateFeedsForCollectionFoldersOperationTests.swift +++ b/Modules/Account/Tests/AccountTests/Feedly/FeedlyCreateFeedsForCollectionFoldersOperationTests.swift @@ -74,7 +74,7 @@ final class FeedlyCreateFeedsForCollectionFoldersOperationTests: XCTestCase { .map { $0.title }) let accountFeeds = account.flattenedFeeds() - let ingestedIds = Set(accountFeeds.map { $0.webFeedID }) + let ingestedIds = Set(accountFeeds.map { $0.feedID }) let ingestedTitles = Set(accountFeeds.map { $0.nameForDisplay }) let missingIds = feedIds.subtracting(ingestedIds) @@ -92,7 +92,7 @@ final class FeedlyCreateFeedsForCollectionFoldersOperationTests: XCTestCase { let ingestedFolderAndFeedIds = (account.folders ?? Set()) .sorted { $0.externalID! < $1.externalID! } .compactMap { folder -> [String: [String]]? in - return [folder.externalID!: folder.topLevelFeeds.map { $0.webFeedID }.sorted(by: <)] + return [folder.externalID!: folder.topLevelFeeds.map { $0.feedID }.sorted(by: <)] } XCTAssertEqual(expectedFolderAndFeedIds, ingestedFolderAndFeedIds, "Did not ingest feeds in their corresponding folders.") @@ -167,7 +167,7 @@ final class FeedlyCreateFeedsForCollectionFoldersOperationTests: XCTestCase { .map { $0.title }) let accountFeeds = account.flattenedFeeds() - let ingestedIds = Set(accountFeeds.map { $0.webFeedID }) + let ingestedIds = Set(accountFeeds.map { $0.feedID }) let ingestedTitles = Set(accountFeeds.map { $0.nameForDisplay }) XCTAssertEqual(ingestedIds.count, feedIds.count) @@ -188,7 +188,7 @@ final class FeedlyCreateFeedsForCollectionFoldersOperationTests: XCTestCase { let ingestedFolderAndFeedIds = (account.folders ?? Set()) .sorted { $0.externalID! < $1.externalID! } .compactMap { folder -> [String: [String]]? in - return [folder.externalID!: folder.topLevelFeeds.map { $0.webFeedID }.sorted(by: <)] + return [folder.externalID!: folder.topLevelFeeds.map { $0.feedID }.sorted(by: <)] } XCTAssertEqual(expectedFolderAndFeedIds, ingestedFolderAndFeedIds, "Did not ingest feeds to their corresponding folders.") diff --git a/Modules/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift b/Modules/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift index 026e048c3..29dc69a0d 100644 --- a/Modules/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift +++ b/Modules/Account/Tests/AccountTests/Feedly/FeedlyTestSupport.swift @@ -139,7 +139,7 @@ final class FeedlyTestSupport { XCTAssertEqual(collectionFeeds.count, folderFeeds.count) let collectionFeedIds = Set(collectionFeeds.map { $0["id"] as! String }) - let folderFeedIds = Set(folderFeeds.map { $0.webFeedID }) + let folderFeedIds = Set(folderFeeds.map { $0.feedID }) let missingFeedIds = collectionFeedIds.subtracting(folderFeedIds) XCTAssertTrue(missingFeedIds.isEmpty, "Feeds with these ids were not found in the \"\(label)\" folder.") diff --git a/Shared/Activity/ActivityManager.swift b/Shared/Activity/ActivityManager.swift index 6e97b2822..ebad048d9 100644 --- a/Shared/Activity/ActivityManager.swift +++ b/Shared/Activity/ActivityManager.swift @@ -151,7 +151,7 @@ final class ActivityManager { } #endif - if activityFeedId == feed.webFeedID { + if activityFeedId == feed.feedID { updateSelectingActivityFeedSearchAttributes(with: feed) } } @@ -279,7 +279,7 @@ private extension ActivityManager { } static func identifier(for feed: Feed) -> String { - return "account_\(feed.account!.accountID)_feed_\(feed.webFeedID)" + return "account_\(feed.account!.accountID)_feed_\(feed.feedID)" } static func identifier(for article: Article) -> String { diff --git a/Shared/Extensions/ArticleUtilities.swift b/Shared/Extensions/ArticleUtilities.swift index 53d4aed2c..7ac609151 100644 --- a/Shared/Extensions/ArticleUtilities.swift +++ b/Shared/Extensions/ArticleUtilities.swift @@ -125,7 +125,7 @@ extension Article { if let image = iconImage() { let fm = FileManager.default var path = fm.urls(for: .cachesDirectory, in: .userDomainMask)[0] - let feedID = webFeed.webFeedID.replacingOccurrences(of: "/", with: "_") + let feedID = webFeed.feedID.replacingOccurrences(of: "/", with: "_") path.appendPathComponent(feedID + "_smallIcon.png") fm.createFile(atPath: path.path, contents: image.image.dataRepresentation()!, attributes: nil) return path diff --git a/Shared/UserNotifications/UserNotificationManager.swift b/Shared/UserNotifications/UserNotificationManager.swift index 59a3b6299..7f55e2c7f 100644 --- a/Shared/UserNotifications/UserNotificationManager.swift +++ b/Shared/UserNotifications/UserNotificationManager.swift @@ -61,7 +61,7 @@ private extension UserNotificationManager { content.subtitle = ArticleStringFormatter.truncatedTitle(article) } content.body = ArticleStringFormatter.truncatedSummary(article) - content.threadIdentifier = webFeed.webFeedID + content.threadIdentifier = webFeed.feedID content.sound = UNNotificationSound.default content.userInfo = [UserInfoKey.articlePath: article.pathUserInfo] content.categoryIdentifier = "NEW_ARTICLE_NOTIFICATION_CATEGORY" @@ -81,7 +81,7 @@ private extension UserNotificationManager { /// - Warning: In certain scenarios, this will return the `faviconTemplateImage`. func thumbnailAttachment(for article: Article, webFeed: Feed) -> UNNotificationAttachment? { if let imageURL = article.iconImageUrl(webFeed: webFeed) { - let thumbnail = try? UNNotificationAttachment(identifier: webFeed.webFeedID, url: imageURL, options: nil) + let thumbnail = try? UNNotificationAttachment(identifier: webFeed.feedID, url: imageURL, options: nil) return thumbnail } return nil diff --git a/iOS/SceneCoordinator.swift b/iOS/SceneCoordinator.swift index 67e5136e1..e2fe2bfa9 100644 --- a/iOS/SceneCoordinator.swift +++ b/iOS/SceneCoordinator.swift @@ -1518,7 +1518,7 @@ private extension SceneCoordinator { treeControllerDelegate.addFilterException(sidebarItemID) } } else if let webFeed = sidebarItem as? Feed { - if webFeed.account?.existingFeed(withFeedID: webFeed.webFeedID) != nil { + if webFeed.account?.existingFeed(withFeedID: webFeed.feedID) != nil { treeControllerDelegate.addFilterException(sidebarItemID) addParentFolderToFilterExceptions(webFeed) } @@ -2121,13 +2121,13 @@ private extension SceneCoordinator { if let feed = timelineFeed as? Feed { for oneFeed in feeds { - if feed.webFeedID == oneFeed.webFeedID || feed.url == oneFeed.url { + if feed.feedID == oneFeed.feedID || feed.url == oneFeed.url { return true } } } else if let folder = timelineFeed as? Folder { for oneFeed in feeds { - if folder.hasFeed(with: oneFeed.webFeedID) || folder.hasFeed(withURL: oneFeed.url) { + if folder.hasFeed(with: oneFeed.feedID) || folder.hasFeed(withURL: oneFeed.url) { return true } } @@ -2292,7 +2292,7 @@ private extension SceneCoordinator { } func findWebFeedNode(webFeedID: String, beginningAt startingNode: Node) -> Node? { - if let node = startingNode.descendantNode(where: { ($0.representedObject as? Feed)?.webFeedID == webFeedID }) { + if let node = startingNode.descendantNode(where: { ($0.representedObject as? Feed)?.feedID == webFeedID }) { return node } return nil