diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index a50582199..0818d6837 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -628,6 +628,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, } func update(feedIDsAndItems: [String: Set], defaultRead: Bool, completion: @escaping (() -> Void)) { + assert(Thread.isMainThread) guard !feedIDsAndItems.isEmpty else { completion() return @@ -652,25 +653,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, } } - func update(_ feed: Feed, parsedItems: Set, defaultRead: Bool = false, _ completion: @escaping (() -> Void)) { - let feedIDsAndItems = [feed.feedID: parsedItems] - database.update(feedIDsAndItems: feedIDsAndItems, defaultRead: defaultRead) { (newArticles, updatedArticles) in - var userInfo = [String: Any]() - if let newArticles = newArticles, !newArticles.isEmpty { - self.updateUnreadCounts(for: Set([feed])) - userInfo[UserInfoKey.newArticles] = newArticles - } - if let updatedArticles = updatedArticles, !updatedArticles.isEmpty { - userInfo[UserInfoKey.updatedArticles] = updatedArticles - } - userInfo[UserInfoKey.feeds] = Set([feed]) - - completion() - - NotificationCenter.default.post(name: .AccountDidDownloadArticles, object: self, userInfo: userInfo) - } - } - @discardableResult func update(_ articles: Set
, statusKey: ArticleStatus.Key, flag: Bool) -> Set
? { // Returns set of Articles whose statuses did change.