Add code to process new article entries.

This commit is contained in:
Maurice Parker
2020-04-10 16:25:58 -05:00
parent 4418a4bb02
commit 983138366f
8 changed files with 65 additions and 22 deletions

View File

@@ -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