mirror of
https://github.com/yattee/yattee.git
synced 2026-02-20 01:39:46 +00:00
Fix feed channel filter avatars showing placeholders instead of images
The filter strip was passing the Invidious instance URL as serverURL to AvatarURLBuilder, which built a Yattee Server-style /avatar/ path that doesn't exist on Invidious. Now passes the actual Yattee Server URL (matching SubscriptionsView pattern) and enriches channels from CachedChannelData as a fallback when the API doesn't return thumbnails.
This commit is contained in:
@@ -94,6 +94,27 @@ struct ChannelID: Codable, Hashable, Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
extension Channel {
|
||||
/// Returns a copy with `thumbnailURL` filled from cached channel data if currently nil.
|
||||
@MainActor
|
||||
func enrichedThumbnail(using dataManager: DataManager) -> Channel {
|
||||
guard thumbnailURL == nil else { return self }
|
||||
guard let cached = CachedChannelData.load(for: id.channelID, using: dataManager) else {
|
||||
return self
|
||||
}
|
||||
return Channel(
|
||||
id: id,
|
||||
name: name,
|
||||
description: description,
|
||||
subscriberCount: subscriberCount ?? cached.subscriberCount,
|
||||
videoCount: videoCount,
|
||||
thumbnailURL: cached.thumbnailURL,
|
||||
bannerURL: bannerURL ?? cached.bannerURL,
|
||||
isVerified: isVerified
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
extension ChannelID: Identifiable {
|
||||
var id: String {
|
||||
switch source {
|
||||
|
||||
Reference in New Issue
Block a user