mirror of
https://github.com/yattee/yattee.git
synced 2026-08-05 23:01:28 +00:00
Apply thumbnail fallback everywhere a single URL was rendered
The previous fix rebuilt the quality chain when converting persisted models back to videos, but many consumers discarded it again by rendering bestThumbnail (usually a maxresdefault.jpg that 404s for older videos) as a single URL with no fallback. Extract the retry logic from VideoThumbnailView into FallbackLazyImage and use it at every in-app site that can iterate: player thumbnails (mini bar, expanded sheet loaders, autoplay previews, tvOS audio-mode artwork - previously a silent black screen), video info card and tvOS header, and the tvOS playlist cover. Sites that fetch or send exactly one URL are rewritten to the always-available hqdefault variant via Thumbnail.reliableURL (exposed as Video.reliableThumbnailURL): Now Playing artwork, Top Shelf snapshots, remote control state, the frozen transition thumbnail, blurred info background, navigation covers, and playlist covers derived from a video's first thumbnail in Invidious/Yattee Server responses. Also invert RecentPlaylist's upgrade helper, which rewrote covers *to* maxresdefault, walk the quality chain when caching download thumbnails for offline artwork instead of giving up after one 404, and expand the remaining single-thumbnail Piped conversions into full chains.
This commit is contained in:
@@ -107,7 +107,9 @@ struct UnifiedPlaylistDetailView: View {
|
||||
}
|
||||
|
||||
private var navigationThumbnailURL: URL? {
|
||||
videos.first?.bestThumbnail?.url ?? thumbnailURL ?? cachedHeader?.thumbnailURL
|
||||
// Rendered as a single URL without fallback, so rewrite to the
|
||||
// always-available hqdefault variant.
|
||||
Thumbnail.reliableURL(for: videos.first?.bestThumbnail?.url ?? thumbnailURL ?? cachedHeader?.thumbnailURL)
|
||||
}
|
||||
|
||||
/// Summary text for the playlist (e.g., "5 videos · 1h 23m").
|
||||
@@ -532,8 +534,9 @@ struct UnifiedPlaylistDetailView: View {
|
||||
|
||||
@ViewBuilder
|
||||
private var tvOSPlaylistThumbnail: some View {
|
||||
let url = videos.first?.bestThumbnail?.url ?? thumbnailURL
|
||||
LazyImage(url: url) { state in
|
||||
let urls = (videos.first?.thumbnailURLsByQuality ?? [])
|
||||
+ [Thumbnail.reliableURL(for: thumbnailURL)].compactMap { $0 }
|
||||
FallbackLazyImage(urls: urls) { state in
|
||||
if let image = state.image {
|
||||
image
|
||||
.resizable()
|
||||
|
||||
Reference in New Issue
Block a user