Update ReaderAPI to use changed database fetch API.

This commit is contained in:
Brent Simmons 2019-07-05 22:46:02 -07:00
parent 3999c7b3c5
commit aab318023c
1 changed files with 4 additions and 4 deletions

View File

@ -943,7 +943,7 @@ private extension ReaderAPIAccountDelegate {
// Mark articles as unread // Mark articles as unread
let deltaUnreadArticleIDs = unreadArticleIDs.subtracting(currentUnreadArticleIDs) let deltaUnreadArticleIDs = unreadArticleIDs.subtracting(currentUnreadArticleIDs)
let markUnreadArticles = account.fetchArticles(forArticleIDs: deltaUnreadArticleIDs) let markUnreadArticles = account.fetchArticles(.articleIDs(deltaUnreadArticleIDs))
DispatchQueue.main.async { DispatchQueue.main.async {
_ = account.update(markUnreadArticles, statusKey: .read, flag: false) _ = account.update(markUnreadArticles, statusKey: .read, flag: false)
} }
@ -959,7 +959,7 @@ private extension ReaderAPIAccountDelegate {
// Mark articles as read // Mark articles as read
let deltaReadArticleIDs = currentUnreadArticleIDs.subtracting(unreadArticleIDs) let deltaReadArticleIDs = currentUnreadArticleIDs.subtracting(unreadArticleIDs)
let markReadArticles = account.fetchArticles(forArticleIDs: deltaReadArticleIDs) let markReadArticles = account.fetchArticles(.articleIDs(deltaReadArticleIDs))
DispatchQueue.main.async { DispatchQueue.main.async {
_ = account.update(markReadArticles, statusKey: .read, flag: true) _ = account.update(markReadArticles, statusKey: .read, flag: true)
} }
@ -986,7 +986,7 @@ private extension ReaderAPIAccountDelegate {
// Mark articles as starred // Mark articles as starred
let deltaStarredArticleIDs = starredArticleIDs.subtracting(currentStarredArticleIDs) let deltaStarredArticleIDs = starredArticleIDs.subtracting(currentStarredArticleIDs)
let markStarredArticles = account.fetchArticles(forArticleIDs: deltaStarredArticleIDs) let markStarredArticles = account.fetchArticles(.articleIDs(deltaStarredArticleIDs))
DispatchQueue.main.async { DispatchQueue.main.async {
_ = account.update(markStarredArticles, statusKey: .starred, flag: true) _ = account.update(markStarredArticles, statusKey: .starred, flag: true)
} }
@ -1002,7 +1002,7 @@ private extension ReaderAPIAccountDelegate {
// Mark articles as unstarred // Mark articles as unstarred
let deltaUnstarredArticleIDs = currentStarredArticleIDs.subtracting(starredArticleIDs) let deltaUnstarredArticleIDs = currentStarredArticleIDs.subtracting(starredArticleIDs)
let markUnstarredArticles = account.fetchArticles(forArticleIDs: deltaUnstarredArticleIDs) let markUnstarredArticles = account.fetchArticles(.articleIDs(deltaUnstarredArticleIDs))
DispatchQueue.main.async { DispatchQueue.main.async {
_ = account.update(markUnstarredArticles, statusKey: .starred, flag: false) _ = account.update(markUnstarredArticles, statusKey: .starred, flag: false)
} }