diff --git a/Modules/Account/Sources/Account/Account.swift b/Modules/Account/Sources/Account/Account.swift index 5a9f6da35..a4dc740ac 100644 --- a/Modules/Account/Sources/Account/Account.swift +++ b/Modules/Account/Sources/Account/Account.swift @@ -866,8 +866,8 @@ public enum FetchType { await database.fetchUnreadCountForStarredArticlesAsync(feedIDs: flattenedFeedsIDs) } - public func fetchCountForStarredArticles() throws -> Int { - try database.fetchStarredArticlesCount(feedIDs: flattenedFeedsIDs) + public func fetchCountForStarredArticles() -> Int { + database.fetchStarredArticlesCount(feedIDs: flattenedFeedsIDs) } public func fetchArticleCountsAsync() async throws -> ArticleCounts { diff --git a/Modules/Account/Sources/Account/AccountManager.swift b/Modules/Account/Sources/Account/AccountManager.swift index e92da557c..520c342aa 100644 --- a/Modules/Account/Sources/Account/AccountManager.swift +++ b/Modules/Account/Sources/Account/AccountManager.swift @@ -440,7 +440,7 @@ import ActivityLog precondition(Thread.isMainThread) var count = 0 for account in activeAccounts { - count += try account.fetchCountForStarredArticles() + count += account.fetchCountForStarredArticles() } return count } diff --git a/Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesDatabase.swift b/Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesDatabase.swift index d5839b2a8..2be7eea07 100644 --- a/Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesDatabase.swift +++ b/Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesDatabase.swift @@ -138,9 +138,9 @@ public struct ArticleCounts: Sendable { return articlesTable.fetchStarredArticles(feedIDs, limit) } - public func fetchStarredArticlesCount(feedIDs: Set) throws -> Int { + public func fetchStarredArticlesCount(feedIDs: Set) -> Int { Self.logger.debug("ArticlesDatabase: \(#function, privacy: .public) \(self.accountID, privacy: .public)") - return try articlesTable.fetchStarredArticlesCount(feedIDs) + return articlesTable.fetchStarredArticlesCount(feedIDs) } /// Returns aggregate article counts (total, unread, starred, statuses) for the given feeds. diff --git a/Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift b/Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift index 8085d534c..452c59d4b 100644 --- a/Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift +++ b/Modules/ArticlesDatabase/Sources/ArticlesDatabase/ArticlesTable.swift @@ -104,8 +104,8 @@ final class ArticlesTable: DatabaseTable, Sendable { fetchArticlesAsync({ self.fetchStarredArticles(feedIDs, limit, $0) }, completion) } - func fetchStarredArticlesCount(_ feedIDs: Set) throws -> Int { - return try fetchArticlesCount { self.fetchStarredArticlesCount(feedIDs, $0) } + func fetchStarredArticlesCount(_ feedIDs: Set) -> Int { + fetchArticlesCount { self.fetchStarredArticlesCount(feedIDs, $0) } } // MARK: - Fetching Counts Async @@ -634,7 +634,7 @@ nonisolated private extension ArticlesTable { return articles } - private func fetchArticlesCount(_ fetchMethod: @escaping ArticlesCountFetchMethod) throws -> Int { + private func fetchArticlesCount(_ fetchMethod: @escaping ArticlesCountFetchMethod) -> Int { nonisolated(unsafe) var articlesCount = 0 queue.runInDatabaseSync { database in