mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add code to process new article entries.
This commit is contained in:
@@ -222,7 +222,7 @@ public final class ArticlesDatabase {
|
||||
return try articlesTable.mark(articles, statusKey, flag)
|
||||
}
|
||||
|
||||
public func markAndFetchNew(articleIDs: Set<String>, statusKey: ArticleStatus.Key, flag: Bool, completion: @escaping ArticleStatusesResultBlock) {
|
||||
public func markAndFetchNew(articleIDs: Set<String>, statusKey: ArticleStatus.Key, flag: Bool, completion: @escaping ArticleIDsCompletionBlock) {
|
||||
articlesTable.markAndFetchNew(articleIDs, statusKey, flag, completion)
|
||||
}
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ final class ArticlesTable: DatabaseTable {
|
||||
return statuses
|
||||
}
|
||||
|
||||
func markAndFetchNew(_ articleIDs: Set<String>, _ statusKey: ArticleStatus.Key, _ flag: Bool, _ completion: @escaping ArticleStatusesResultBlock) {
|
||||
func markAndFetchNew(_ articleIDs: Set<String>, _ statusKey: ArticleStatus.Key, _ flag: Bool, _ completion: @escaping ArticleIDsCompletionBlock) {
|
||||
queue.runInTransaction { databaseResult in
|
||||
switch databaseResult {
|
||||
case .success(let database):
|
||||
|
||||
@@ -85,11 +85,11 @@ final class StatusesTable: DatabaseTable {
|
||||
return updatedStatuses
|
||||
}
|
||||
|
||||
func markAndFetchNew(_ articleIDs: Set<String>, _ statusKey: ArticleStatus.Key, _ flag: Bool, _ database: FMDatabase) -> Set<ArticleStatus> {
|
||||
func markAndFetchNew(_ articleIDs: Set<String>, _ statusKey: ArticleStatus.Key, _ flag: Bool, _ database: FMDatabase) -> Set<String> {
|
||||
let (statusesDictionary, newStatusIDs) = ensureStatusesForArticleIDs(articleIDs, flag, database)
|
||||
let statuses = Set(statusesDictionary.values)
|
||||
mark(statuses, statusKey, flag, database)
|
||||
return Set(newStatusIDs.compactMap({ statusesDictionary[$0] }))
|
||||
return newStatusIDs
|
||||
}
|
||||
|
||||
// MARK: - Fetching
|
||||
|
||||
Reference in New Issue
Block a user