diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift index 516f1bf9a..b8b719307 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController.swift @@ -801,7 +801,16 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr } // Articles that used the failed URL now get their next source, or none. let articleIDs = Set(thumbnailURLCache.filter { $0.value == url }.keys) + guard !articleIDs.isEmpty else { + return + } thumbnailURLsDidChange(for: articleIDs) + + // A failed provided image falls back to images in the HTML. + let articlesUsingURL = articles.filter { articleIDs.contains($0.articleID) } + Task { + await ArticleThumbnailFinder.shared.discoverThumbnailURLs(for: articlesUsingURL) + } } @objc nonisolated func handleUserDefaultsDidChange(_ notification: Notification) { diff --git a/iOS/MainTimeline/MainTimelineViewController.swift b/iOS/MainTimeline/MainTimelineViewController.swift index 621618bc6..18e4f897c 100644 --- a/iOS/MainTimeline/MainTimelineViewController.swift +++ b/iOS/MainTimeline/MainTimelineViewController.swift @@ -1281,7 +1281,18 @@ private extension MainTimelineViewController { } // Articles that used the failed URL now get their next source, or none. let articleIDs = Set(thumbnailURLCache.filter { $0.value == url }.keys) + guard !articleIDs.isEmpty else { + return + } thumbnailURLsDidChange(for: articleIDs) + + // A failed provided image falls back to images in the HTML. + guard let articlesUsingURL = articles?.filter({ articleIDs.contains($0.articleID) }) else { + return + } + Task { + await ArticleThumbnailFinder.shared.discoverThumbnailURLs(for: articlesUsingURL) + } } @objc func contentSizeCategoryDidChange(_ note: Notification) {