mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Bring in code from previous iOS release.
This commit is contained in:
@@ -699,6 +699,10 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
||||
database.fetchStarredAndUnreadCount(for: flattenedWebFeeds().webFeedIDs(), completion: completion)
|
||||
}
|
||||
|
||||
public func fetchCountForStarredArticles() throws -> Int {
|
||||
return try database.fetchStarredArticlesCount(flattenedWebFeeds().webFeedIDs())
|
||||
}
|
||||
|
||||
public func fetchUnreadArticleIDs(_ completion: @escaping ArticleIDsCompletionBlock) {
|
||||
database.fetchUnreadArticleIDsAsync(completion: completion)
|
||||
}
|
||||
|
||||
@@ -405,6 +405,17 @@ public final class AccountManager: UnreadCountProvider {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Fetching Article Counts
|
||||
|
||||
public func fetchCountForStarredArticles() throws -> Int {
|
||||
precondition(Thread.isMainThread)
|
||||
var count = 0
|
||||
for account in activeAccounts {
|
||||
count += try account.fetchCountForStarredArticles()
|
||||
}
|
||||
return count
|
||||
}
|
||||
|
||||
// MARK: - Caches
|
||||
|
||||
/// Empty caches that can reasonably be emptied — when the app moves to the background, for instance.
|
||||
|
||||
Reference in New Issue
Block a user