mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-27 09:21:21 +01:00
Remove no-longer-used ensureStatuses functions.
This commit is contained in:
parent
e2db7b4a5d
commit
704ccb2927
@ -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) {
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user