From 03bf97df9036b13eb73c5d06b567f9d6264f3c05 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 8 Sep 2019 21:52:02 -0700 Subject: [PATCH] Fix parts of ReaderAPI implementation that I broke with an API change in Account. --- .../Account/ReaderAPI/ReaderAPIAccountDelegate.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Frameworks/Account/ReaderAPI/ReaderAPIAccountDelegate.swift b/Frameworks/Account/ReaderAPI/ReaderAPIAccountDelegate.swift index 3146fab0d..1d5e376a8 100644 --- a/Frameworks/Account/ReaderAPI/ReaderAPIAccountDelegate.swift +++ b/Frameworks/Account/ReaderAPI/ReaderAPIAccountDelegate.swift @@ -549,7 +549,7 @@ private extension ReaderAPIAccountDelegate { subscriptions.forEach { subscription in let subFeedId = String(subscription.feedID) - if let feed = account.idToFeedDictionary[subFeedId] { + if let feed = account.existingFeed(withFeedID: subFeedId) { feed.name = subscription.name feed.homePageURL = subscription.homePageURL } else { @@ -619,8 +619,7 @@ private extension ReaderAPIAccountDelegate { for subscription in groupedTaggings { let taggingFeedID = String(subscription.feedID) if !folderFeedIds.contains(taggingFeedID) { - let idDictionary = account.idToFeedDictionary - guard let feed = idDictionary[taggingFeedID] else { + guard let feed = account.existingFeed(withFeedID: taggingFeedID) else { continue } saveFolderRelationship(for: feed, withFolderName: folderName, id: String(subscription.feedID)) @@ -880,7 +879,7 @@ private extension ReaderAPIAccountDelegate { group.enter() - if let feed = account.idToFeedDictionary[feedID] { + if let feed = account.existingFeed(withFeedID: feedID) { DispatchQueue.main.async { account.update(feed, parsedItems: Set(mapItems), defaultRead: true) { group.leave()