mirror of
https://github.com/yattee/yattee.git
synced 2025-01-10 03:20:33 +05:30
Fix parsing subscriptions published date
This commit is contained in:
parent
cf68c6c69f
commit
78834b1548
@ -309,8 +309,12 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
|
|||||||
let author = details["uploaderName"]?.stringValue ?? details["uploader"]!.stringValue
|
let author = details["uploaderName"]?.stringValue ?? details["uploader"]!.stringValue
|
||||||
let authorThumbnailURL = details["avatarUrl"]?.url ?? details["uploaderAvatar"]?.url ?? details["avatar"]?.url
|
let authorThumbnailURL = details["avatarUrl"]?.url ?? details["uploaderAvatar"]?.url ?? details["avatar"]?.url
|
||||||
|
|
||||||
let published = (details["uploadedDate"] ?? details["uploadDate"])?.stringValue ??
|
let uploaded = details["uploaded"]?.doubleValue
|
||||||
(details["uploaded"]!.double! / 1000).formattedAsRelativeTime()!
|
var published = uploaded.isNil ? nil : (uploaded! / 1000).formattedAsRelativeTime()
|
||||||
|
if published.isNil {
|
||||||
|
published = (details["uploadedDate"] ?? details["uploadDate"])?.stringValue ?? ""
|
||||||
|
}
|
||||||
|
|
||||||
let live = details["livestream"]?.boolValue ?? (details["duration"]?.intValue == -1)
|
let live = details["livestream"]?.boolValue ?? (details["duration"]?.intValue == -1)
|
||||||
|
|
||||||
return Video(
|
return Video(
|
||||||
@ -318,7 +322,7 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
|
|||||||
title: details["title"]!.stringValue,
|
title: details["title"]!.stringValue,
|
||||||
author: author,
|
author: author,
|
||||||
length: details["duration"]!.doubleValue,
|
length: details["duration"]!.doubleValue,
|
||||||
published: published,
|
published: published!,
|
||||||
views: details["views"]!.intValue,
|
views: details["views"]!.intValue,
|
||||||
description: extractDescription(from: content),
|
description: extractDescription(from: content),
|
||||||
channel: Channel(id: channelId, name: author, thumbnailURL: authorThumbnailURL),
|
channel: Channel(id: channelId, name: author, thumbnailURL: authorThumbnailURL),
|
||||||
|
Loading…
Reference in New Issue
Block a user