Remove no-longer-used ensureStatuses functions.

This commit is contained in:
Brent Simmons 2019-12-16 23:06:21 -08:00
parent e2db7b4a5d
commit 704ccb2927
3 changed files with 0 additions and 35 deletions

View File

@ -770,14 +770,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
return updatedArticles
}
func ensureStatuses(_ articleIDs: Set<String>, _ defaultRead: Bool, _ statusKey: ArticleStatus.Key, _ flag: Bool, completion: @escaping DatabaseCompletionBlock) {
guard !articleIDs.isEmpty else {
completion(nil)
return
}
database.ensureStatuses(articleIDs, defaultRead, statusKey, flag, completion: completion)
}
/// Mark articleIDs statuses based on statusKey and flag.
/// Will create statuses in the database and in memory as needed. Sends a .StatusesDidChange notification.
func mark(articleIDs: Set<String>, statusKey: ArticleStatus.Key, flag: Bool, completion: DatabaseCompletionBlock? = nil) {

View File

@ -164,10 +164,6 @@ public final class ArticlesDatabase {
articlesTable.update(webFeedIDsAndItems, defaultRead, completion)
}
public func ensureStatuses(_ articleIDs: Set<String>, _ defaultRead: Bool, _ statusKey: ArticleStatus.Key, _ flag: Bool, completion: @escaping DatabaseCompletionBlock) {
articlesTable.ensureStatuses(articleIDs, defaultRead, statusKey, flag, completion: completion)
}
// MARK: - Status
/// Fetch the articleIDs of unread articles in feeds specified by webFeedIDs.

View File

@ -236,29 +236,6 @@ final class ArticlesTable: DatabaseTable {
}
}
func ensureStatuses(_ articleIDs: Set<String>, _ defaultRead: Bool, _ statusKey: ArticleStatus.Key, _ flag: Bool, completion: @escaping DatabaseCompletionBlock) {
queue.runInTransaction { databaseResult in
func makeDatabaseCalls(_ database: FMDatabase) {
let statusesDictionary = self.statusesTable.ensureStatusesForArticleIDs(articleIDs, defaultRead, database)
let statuses = Set(statusesDictionary.values)
self.statusesTable.mark(statuses, statusKey, flag, database)
DispatchQueue.main.async {
completion(nil)
}
}
switch databaseResult {
case .success(let database):
makeDatabaseCalls(database)
case .failure(let databaseError):
DispatchQueue.main.async {
completion(databaseError)
}
}
}
}
func fetchStatuses(_ articleIDs: Set<String>, _ createIfNeeded: Bool, _ completion: @escaping ArticleStatusesResultBlock) {
queue.runInTransaction { databaseResult in