mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 19:05:03 +00:00
Refresh expired thumbnail URLs for downloads and video info
Proxied thumbnail URLs from Invidious/Piped/Yattee server expire over time. Two paths were left holding stale URLs: the Video Info carousel kept the original list copy even after fresh details arrived, and downloaded videos rendered from the remote URL snapshot taken at download time while the local thumbnail on disk was ignored. Evict stale URLs from the Nuke cache when fresh video details load, pass the fresh details through to the videoCard thumbnail, and resolve downloads' thumbnails from the local file when localThumbnailPath is set.
This commit is contained in:
@@ -63,6 +63,15 @@ final class ImageLoadingService: Sendable {
|
||||
)
|
||||
}
|
||||
|
||||
/// Remove a specific URL from both the memory and disk image caches.
|
||||
/// Use when a previously cached URL is known to return stale or broken
|
||||
/// data (e.g. an expired proxied thumbnail URL).
|
||||
func removeCachedImage(for url: URL) {
|
||||
let request = ImageRequest(url: url)
|
||||
ImagePipeline.shared.cache.removeCachedImage(for: request)
|
||||
ImagePipeline.shared.cache.removeCachedData(for: request)
|
||||
}
|
||||
|
||||
/// Clear all image caches (memory and disk).
|
||||
func clearCache() {
|
||||
// Clear memory cache
|
||||
|
||||
Reference in New Issue
Block a user