mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-30 01:10:38 +00:00
Fall back to home page icon when feed icon URL returns something other than an image. Fixes #5376.
This commit is contained in:
1 parent
3735f095fc
commit
defd3db2b2
2 files changed
+6
-1
No files matched your search
@@ -142,6 +142,11 @@ extension Notification.Name {
|
||||
downloadQueue.prioritize(key: url)
|
||||
}
|
||||
|
||||
/// True when the URL returned something other than an image, and the network status hasn’t changed since.
|
||||
func returnedNonImage(_ url: String) -> Bool {
|
||||
urlsThatReturnedNonImage.contains(url)
|
||||
}
|
||||
|
||||
/// A copy made from the image at `url`, such as a scaled icon. Nil when none has been saved.
|
||||
func derivedImageData(for url: String, suffix: String) async -> Data? {
|
||||
await Self.readFromDisk(diskCache, key: Self.derivedDiskKey(url, suffix: suffix))
|
||||
|
||||
@@ -257,7 +257,7 @@ private extension FeedIconDownloader {
|
||||
}
|
||||
|
||||
let urlIsUnfetchable = !url.hasPrefix("http://") && !url.hasPrefix("https://")
|
||||
if urlIsUnfetchable || ImageDatabase.shared.recentlyFailed(url: url) {
|
||||
if urlIsUnfetchable || ImageDatabase.shared.recentlyFailed(url: url) || DownloadedImageCache.shared.returnedNonImage(url) {
|
||||
imageResultBlock(nil, true)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user