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:
Arkadiusz Fal
2026-02-13 07:04:40 +01:00
parent 9eb6812fb2
commit e51ebd7ab2
2 changed files with 37 additions and 4 deletions

View File

@@ -67,12 +67,24 @@ struct InstanceBrowseView: View {
appEnvironment?.settingsManager.listStyle ?? .inset
}
/// Auth header for Yattee Server instances
/// The first enabled Yattee Server instance (for avatar URLs).
private var yatteeServer: Instance? {
appEnvironment?.instancesManager.enabledYatteeServerInstances.first
}
private var yatteeServerURL: URL? { yatteeServer?.url }
/// Auth header for Yattee Server instances (when browsing a Yattee Server directly)
private var yatteeServerAuthHeader: String? {
guard instance.type == .yatteeServer else { return nil }
return appEnvironment?.yatteeServerCredentialsManager.basicAuthHeader(for: instance)
}
/// Auth header for avatar loading (uses Yattee Server for YouTube channel avatars)
private var avatarAuthHeader: String? {
guard let server = yatteeServer else { return nil }
return appEnvironment?.yatteeServerCredentialsManager.basicAuthHeader(for: server)
}
enum BrowseTab: String, CaseIterable, Identifiable {
case popular
case trending
@@ -425,7 +437,7 @@ struct InstanceBrowseView: View {
channelID: subscription.id.channelID,
name: subscription.name,
avatarURL: subscription.thumbnailURL,
serverURL: instance.url,
serverURL: yatteeServerURL,
isSelected: selectedFeedChannelID == subscription.id.channelID,
avatarSize: 44,
onTap: {
@@ -441,7 +453,7 @@ struct InstanceBrowseView: View {
)
},
onUnsubscribe: nil,
authHeader: yatteeServerAuthHeader
authHeader: avatarAuthHeader
)
}
}
@@ -929,7 +941,7 @@ struct InstanceBrowseView: View {
return
}
feedSubscriptions = subscriptionChannels
feedSubscriptions = subscriptionChannels.map { $0.enrichedThumbnail(using: appEnvironment.dataManager) }
feedVideos = videos
prefetchBranding(for: videos)
case .playlists: