Use UnreadCountDictionary instead of UnreadCountTable.
This commit is contained in:
parent
72cfc84001
commit
66129841a5
|
@ -115,16 +115,16 @@ final class ArticlesTable: DatabaseTable {
|
|||
func fetchUnreadCounts(_ feeds: Set<Feed>, _ completion: @escaping UnreadCountCompletionBlock) {
|
||||
|
||||
let feedIDs = feeds.feedIDs()
|
||||
var unreadCountTable = UnreadCountTable()
|
||||
var unreadCountDictionary = UnreadCountDictionary()
|
||||
|
||||
queue.fetch { (database) in
|
||||
|
||||
for feedID in feedIDs {
|
||||
unreadCountTable[feedID] = self.fetchUnreadCount(feedID, database)
|
||||
unreadCountDictionary[feedID] = self.fetchUnreadCount(feedID, database)
|
||||
}
|
||||
|
||||
DispatchQueue.main.async() {
|
||||
completion(unreadCountTable)
|
||||
completion(unreadCountDictionary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,8 +13,7 @@ import RSParser
|
|||
import Data
|
||||
|
||||
public typealias ArticleResultBlock = (Set<Article>) -> Void
|
||||
public typealias UnreadCountTable = [String: Int] // feedID: unreadCount
|
||||
public typealias UnreadCountCompletionBlock = (UnreadCountTable) -> Void //feedID: unreadCount
|
||||
public typealias UnreadCountCompletionBlock = (UnreadCountDictionary) -> Void
|
||||
public typealias UpdateArticlesWithFeedCompletionBlock = (Set<Article>?, Set<Article>?) -> Void //newArticles, updateArticles
|
||||
|
||||
public final class Database {
|
||||
|
|
Loading…
Reference in New Issue