mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-09 08:39:00 +01:00
Merge branch 'mac-release'
This commit is contained in:
commit
c04322990c
@ -628,6 +628,7 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func update(feedIDsAndItems: [String: Set<ParsedItem>], defaultRead: Bool, completion: @escaping (() -> Void)) {
|
func update(feedIDsAndItems: [String: Set<ParsedItem>], defaultRead: Bool, completion: @escaping (() -> Void)) {
|
||||||
|
assert(Thread.isMainThread)
|
||||||
guard !feedIDsAndItems.isEmpty else {
|
guard !feedIDsAndItems.isEmpty else {
|
||||||
completion()
|
completion()
|
||||||
return
|
return
|
||||||
@ -652,25 +653,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func update(_ feed: Feed, parsedItems: Set<ParsedItem>, defaultRead: Bool = false, _ completion: @escaping (() -> Void)) {
|
|
||||||
let feedIDsAndItems = [feed.feedID: parsedItems]
|
|
||||||
database.update(feedIDsAndItems: feedIDsAndItems, defaultRead: defaultRead) { (newArticles, updatedArticles) in
|
|
||||||
var userInfo = [String: Any]()
|
|
||||||
if let newArticles = newArticles, !newArticles.isEmpty {
|
|
||||||
self.updateUnreadCounts(for: Set([feed]))
|
|
||||||
userInfo[UserInfoKey.newArticles] = newArticles
|
|
||||||
}
|
|
||||||
if let updatedArticles = updatedArticles, !updatedArticles.isEmpty {
|
|
||||||
userInfo[UserInfoKey.updatedArticles] = updatedArticles
|
|
||||||
}
|
|
||||||
userInfo[UserInfoKey.feeds] = Set([feed])
|
|
||||||
|
|
||||||
completion()
|
|
||||||
|
|
||||||
NotificationCenter.default.post(name: .AccountDidDownloadArticles, object: self, userInfo: userInfo)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
func update(_ articles: Set<Article>, statusKey: ArticleStatus.Key, flag: Bool) -> Set<Article>? {
|
func update(_ articles: Set<Article>, statusKey: ArticleStatus.Key, flag: Bool) -> Set<Article>? {
|
||||||
// Returns set of Articles whose statuses did change.
|
// Returns set of Articles whose statuses did change.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user