Merge branch 'mac-candidate'
This commit is contained in:
commit
3c4379dfeb
|
@ -271,13 +271,11 @@ final class ArticlesTable: DatabaseTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ensureStatuses(_ articleIDs: Set<String>, _ statusKey: ArticleStatus.Key, _ flag: Bool) {
|
func ensureStatuses(_ articleIDs: Set<String>, _ statusKey: ArticleStatus.Key, _ flag: Bool) {
|
||||||
|
self.queue.update { (database) in
|
||||||
self.queue.updateSync { (database) in
|
|
||||||
let statusesDictionary = self.statusesTable.ensureStatusesForArticleIDs(articleIDs, false, database)
|
let statusesDictionary = self.statusesTable.ensureStatusesForArticleIDs(articleIDs, false, database)
|
||||||
let statuses = Set(statusesDictionary.values)
|
let statuses = Set(statusesDictionary.values)
|
||||||
_ = self.statusesTable.mark(statuses, statusKey, flag, database)
|
self.statusesTable.mark(statuses, statusKey, flag, database)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Unread Counts
|
// MARK: Unread Counts
|
||||||
|
|
|
@ -50,6 +50,7 @@ final class StatusesTable: DatabaseTable {
|
||||||
|
|
||||||
// MARK: Marking
|
// MARK: Marking
|
||||||
|
|
||||||
|
@discardableResult
|
||||||
func mark(_ statuses: Set<ArticleStatus>, _ statusKey: ArticleStatus.Key, _ flag: Bool, _ database: FMDatabase) -> Set<ArticleStatus>? {
|
func mark(_ statuses: Set<ArticleStatus>, _ statusKey: ArticleStatus.Key, _ flag: Bool, _ database: FMDatabase) -> Set<ArticleStatus>? {
|
||||||
|
|
||||||
// Sets flag in both memory and in database.
|
// Sets flag in both memory and in database.
|
||||||
|
|
Loading…
Reference in New Issue