mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-02 10:22:35 +00:00
Prefer a feed's declared icon over a previously discovered home-page icon. Fixes #5376.
This commit is contained in:
1 parent
cc19be05a6
commit
a2b1ea7e5e
1 file changed
+12
-9
@@ -97,16 +97,19 @@ extension Notification.Name {
|
||||
}
|
||||
}
|
||||
|
||||
if let previouslyFoundIconURL = ImageMetadataDatabase.shared.iconURL(forFeedURL: feed.url) {
|
||||
// The stored icon URL remembers an icon discovered via the home page. A feed
|
||||
// that declares its own icon supersedes it.
|
||||
// <https://github.com/Ranchero-Software/NetNewsWire/issues/5376>
|
||||
let feedDeclaresIconURL = feed.iconURL != nil && !Self.shouldIgnoreFeedIconURL(feed)
|
||||
|
||||
if !feedDeclaresIconURL, let previouslyFoundIconURL = ImageMetadataDatabase.shared.iconURL(forFeedURL: feed.url) {
|
||||
icon(forURL: previouslyFoundIconURL, feed: feed) { image, _ in
|
||||
MainActor.assumeIsolated {
|
||||
if self.cache[feed] != nil {
|
||||
return // already cached
|
||||
}
|
||||
if let image {
|
||||
self.cache[feed] = IconImage(image)
|
||||
self.postFeedIconDidBecomeAvailableNotification(feed)
|
||||
}
|
||||
if self.cache[feed] != nil {
|
||||
return // already cached
|
||||
}
|
||||
if let image {
|
||||
self.cache[feed] = IconImage(image)
|
||||
self.postFeedIconDidBecomeAvailableNotification(feed)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user