mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Fix Invidious channel videos
This commit is contained in:
@@ -72,14 +72,21 @@ struct FavoriteItemView: View {
|
||||
}
|
||||
}
|
||||
case let .channel(_, id, name):
|
||||
let channel = Channel(app: .invidious, id: id, name: name)
|
||||
if let cache = ChannelsCacheModel.shared.retrieve(channel.cacheKey) {
|
||||
var channel = Channel(app: .invidious, id: id, name: name)
|
||||
if let cache = ChannelsCacheModel.shared.retrieve(channel.cacheKey),
|
||||
!cache.videos.isEmpty
|
||||
{
|
||||
contentItems = ContentItem.array(of: cache.videos)
|
||||
}
|
||||
|
||||
onSuccess = { response in
|
||||
if let channel: Channel = response.typedContent() {
|
||||
ChannelsCacheModel.shared.store(channel)
|
||||
store.contentItems = ContentItem.array(of: channel.videos)
|
||||
} else if let videos: [Video] = response.typedContent() {
|
||||
channel.videos = videos
|
||||
ChannelsCacheModel.shared.store(channel)
|
||||
store.contentItems = ContentItem.array(of: videos)
|
||||
}
|
||||
}
|
||||
case let .channelPlaylist(_, id, title):
|
||||
|
Reference in New Issue
Block a user