mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 22:00:31 +05:30
Fix playlists on Piped
This commit is contained in:
parent
97e9889682
commit
b7c3eb0248
@ -370,12 +370,14 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
|
||||
|
||||
func extractChannelPlaylist(from json: JSON) -> ChannelPlaylist? {
|
||||
let details = json.dictionaryValue
|
||||
let id = details["url"]?.stringValue.components(separatedBy: "?list=").last
|
||||
let thumbnailURL = details["thumbnail"]?.url ?? details["thumbnailUrl"]?.url
|
||||
var videos = [Video]()
|
||||
if let relatedStreams = details["relatedStreams"] {
|
||||
videos = extractVideos(from: relatedStreams)
|
||||
}
|
||||
return ChannelPlaylist(
|
||||
id: id ?? UUID().uuidString,
|
||||
title: details["name"]?.string ?? "",
|
||||
thumbnailURL: thumbnailURL,
|
||||
channel: extractChannel(from: json),
|
||||
|
Loading…
Reference in New Issue
Block a user