From 12e427bcb8c4e0994aeccb940492498c23d8c29d Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Thu, 30 Jun 2022 10:11:11 +0200 Subject: [PATCH] Fix playlists parsing with Invidious --- Model/Applications/InvidiousAPI.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Model/Applications/InvidiousAPI.swift b/Model/Applications/InvidiousAPI.swift index 9aee3d4e..af1d3092 100644 --- a/Model/Applications/InvidiousAPI.swift +++ b/Model/Applications/InvidiousAPI.swift @@ -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) ?? []