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

Fix marking live videos from Piped

This commit is contained in:
Arkadiusz Fal 2021-12-26 20:14:45 +01:00
parent e06febd2e3
commit 32862ab446

View File

@ -298,6 +298,7 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
let published = (details["uploadedDate"] ?? details["uploadDate"])?.stringValue ??
(details["uploaded"]!.double! / 1000).formattedAsRelativeTime()!
let live = details["livestream"]?.boolValue ?? (details["duration"]?.intValue == -1)
return Video(
videoID: extractID(from: content),
@ -309,6 +310,7 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
description: extractDescription(from: content),
channel: Channel(id: channelId, name: author, thumbnailURL: authorThumbnailURL),
thumbnails: thumbnails,
live: live,
likes: details["likes"]?.int,
dislikes: details["dislikes"]?.int,
streams: extractStreams(from: content),