Create and use IconImageCache. It centralizes and de-dupes logic for getting feed/article images, and it caches the results, which helps performance.

This commit is contained in:
Brent Simmons
2021-05-08 12:42:44 -07:00
parent 28b00260e0
commit 9d2c8f000f
12 changed files with 160 additions and 174 deletions

View File

@@ -763,7 +763,7 @@ private extension SidebarViewController {
}
func imageFor(_ node: Node) -> IconImage? {
if let feed = node.representedObject as? WebFeed, let feedIcon = appDelegate.webFeedIconDownloader.icon(for: feed) {
if let feed = node.representedObject as? WebFeed, let feedIcon = IconImageCache.shared.imageForFeed(feed) {
return feedIcon
}
if let smallIconProvider = node.representedObject as? SmallIconProvider {