Remove no-longer-used fetchStatuses functions.
This commit is contained in:
parent
704ccb2927
commit
567a971a1c
|
@ -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<ArticleStatus> as first parameter.
|
||||
func fetchStatuses(articleIDs: Set<String>, 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()
|
||||
|
|
|
@ -188,10 +188,6 @@ public final class ArticlesDatabase {
|
|||
articlesTable.mark(articleIDs, statusKey, flag, completion)
|
||||
}
|
||||
|
||||
public func fetchStatuses(articleIDs: Set<String>, createIfNeeded: Bool, completion: @escaping ArticleStatusesResultBlock) {
|
||||
articlesTable.fetchStatuses(articleIDs, createIfNeeded, completion)
|
||||
}
|
||||
|
||||
// MARK: - Suspend and Resume (for iOS)
|
||||
|
||||
/// Close the database and stop running database calls.
|
||||
|
|
|
@ -236,34 +236,6 @@ final class ArticlesTable: DatabaseTable {
|
|||
}
|
||||
}
|
||||
|
||||
func fetchStatuses(_ articleIDs: Set<String>, _ 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<String>, _ completion: @escaping UnreadCountDictionaryCompletionBlock) {
|
||||
|
|
Loading…
Reference in New Issue