mirror of
https://github.com/yattee/yattee.git
synced 2024-12-14 06:10:32 +05:30
Fix playlists parsing with Invidious
This commit is contained in:
parent
e477d90620
commit
979e3cae8f
@ -442,8 +442,8 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
|
|||||||
func extractChannelPlaylist(from json: JSON) -> ChannelPlaylist {
|
func extractChannelPlaylist(from json: JSON) -> ChannelPlaylist {
|
||||||
let details = json.dictionaryValue
|
let details = json.dictionaryValue
|
||||||
return ChannelPlaylist(
|
return ChannelPlaylist(
|
||||||
id: details["playlistId"]!.stringValue,
|
id: details["playlistId"]?.string ?? details["mixId"]?.string ?? UUID().uuidString,
|
||||||
title: details["title"]!.stringValue,
|
title: details["title"]?.stringValue ?? "",
|
||||||
thumbnailURL: details["playlistThumbnail"]?.url,
|
thumbnailURL: details["playlistThumbnail"]?.url,
|
||||||
channel: extractChannel(from: json),
|
channel: extractChannel(from: json),
|
||||||
videos: details["videos"]?.arrayValue.compactMap(extractVideo) ?? []
|
videos: details["videos"]?.arrayValue.compactMap(extractVideo) ?? []
|
||||||
|
Loading…
Reference in New Issue
Block a user