diff --git a/Frameworks/Account/Account.swift b/Frameworks/Account/Account.swift index ccf0e0654..953e59677 100644 --- a/Frameworks/Account/Account.swift +++ b/Frameworks/Account/Account.swift @@ -807,12 +807,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container, mark(articleIDs: articleIDs, statusKey: .starred, flag: false) } - /// Fetch statuses for the specified articleIDs. The completion handler will get nil if the app is suspended. - /// To update the properties in the database, call the update method that takes Set as first parameter. - func fetchStatuses(articleIDs: Set, createIfNeeded: Bool, completion: @escaping ArticleStatusesResultBlock) { - database.fetchStatuses(articleIDs: articleIDs, createIfNeeded: createIfNeeded, completion: completion) - } - /// Empty caches that can reasonably be emptied. Call when the app goes in the background, for instance. func emptyCaches() { database.emptyCaches() diff --git a/Frameworks/ArticlesDatabase/ArticlesDatabase.swift b/Frameworks/ArticlesDatabase/ArticlesDatabase.swift index 39ef87369..3fca7e321 100644 --- a/Frameworks/ArticlesDatabase/ArticlesDatabase.swift +++ b/Frameworks/ArticlesDatabase/ArticlesDatabase.swift @@ -188,10 +188,6 @@ public final class ArticlesDatabase { articlesTable.mark(articleIDs, statusKey, flag, completion) } - public func fetchStatuses(articleIDs: Set, createIfNeeded: Bool, completion: @escaping ArticleStatusesResultBlock) { - articlesTable.fetchStatuses(articleIDs, createIfNeeded, completion) - } - // MARK: - Suspend and Resume (for iOS) /// Close the database and stop running database calls. diff --git a/Frameworks/ArticlesDatabase/ArticlesTable.swift b/Frameworks/ArticlesDatabase/ArticlesTable.swift index 1140125a5..288aca756 100644 --- a/Frameworks/ArticlesDatabase/ArticlesTable.swift +++ b/Frameworks/ArticlesDatabase/ArticlesTable.swift @@ -236,34 +236,6 @@ final class ArticlesTable: DatabaseTable { } } - func fetchStatuses(_ articleIDs: Set, _ createIfNeeded: Bool, _ completion: @escaping ArticleStatusesResultBlock) { - queue.runInTransaction { databaseResult in - - func makeDatabaseCalls(_ database: FMDatabase) { - var statusesDictionary = [String: ArticleStatus]() - if createIfNeeded { - statusesDictionary = self.statusesTable.ensureStatusesForArticleIDs(articleIDs, false, database) - } - else { - statusesDictionary = self.statusesTable.existingStatusesForArticleIDs(articleIDs, database) - } - let statuses = Set(statusesDictionary.values) - DispatchQueue.main.async { - completion(.success(statuses)) - } - } - - switch databaseResult { - case .success(let database): - makeDatabaseCalls(database) - case .failure(let databaseError): - DispatchQueue.main.async { - completion(.failure(databaseError)) - } - } - } - } - // MARK: - Unread Counts func fetchUnreadCounts(_ webFeedIDs: Set, _ completion: @escaping UnreadCountDictionaryCompletionBlock) {