1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 22:00:31 +05:30

Fix playlists parsing with Invidious

This commit is contained in:
Arkadiusz Fal 2022-06-30 10:11:11 +02:00
parent 117c4fc9b6
commit 12e427bcb8

View File

@ -442,8 +442,8 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
func extractChannelPlaylist(from json: JSON) -> ChannelPlaylist {
let details = json.dictionaryValue
return ChannelPlaylist(
id: details["playlistId"]!.stringValue,
title: details["title"]!.stringValue,
id: details["playlistId"]?.string ?? details["mixId"]?.string ?? UUID().uuidString,
title: details["title"]?.stringValue ?? "",
thumbnailURL: details["playlistThumbnail"]?.url,
channel: extractChannel(from: json),
videos: details["videos"]?.arrayValue.compactMap(extractVideo) ?? []