mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
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:
@@ -41,20 +41,6 @@ final class FeedIconImageLoader: ObservableObject {
|
||||
private extension FeedIconImageLoader {
|
||||
|
||||
func fetchImage() {
|
||||
if let webFeed = feed as? WebFeed {
|
||||
if let feedIconImage = appDelegate.webFeedIconDownloader.icon(for: webFeed) {
|
||||
image = feedIconImage
|
||||
return
|
||||
}
|
||||
if let faviconImage = appDelegate.faviconDownloader.faviconAsIcon(for: webFeed) {
|
||||
image = faviconImage
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if let smallIconProvider = feed as? SmallIconProvider {
|
||||
image = smallIconProvider.smallIcon
|
||||
}
|
||||
image = IconImageCache.shared.imageForFeed(feed)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user