Add live flag to IptvPlayInfo so the Viaplay hub archive builds.
This commit is contained in:
parent
084bcdaeff
commit
e303dc4d37
1 changed files with 11 additions and 1 deletions
|
|
@ -142,10 +142,18 @@ struct MovieDetail: Decodable {
|
|||
let cast: [String]?
|
||||
let director: [String]?
|
||||
let mediaFiles: [MediaFileInfo]?
|
||||
let positionMs: Int64?
|
||||
let durationMs: Int64?
|
||||
let completed: Bool?
|
||||
|
||||
var preferredMediaFileId: String? {
|
||||
mediaFiles?.first(where: { $0.nodeOnline != false })?.id ?? mediaFiles?.first?.id
|
||||
}
|
||||
|
||||
var resumeMs: Int64 {
|
||||
if completed == true { return 0 }
|
||||
return max(0, positionMs ?? 0)
|
||||
}
|
||||
}
|
||||
|
||||
struct SeriesDetail: Decodable {
|
||||
|
|
@ -293,11 +301,12 @@ struct IptvPlayInfo: Decodable {
|
|||
let fallbackFormat: String?
|
||||
let drm: DrmInfo?
|
||||
let watchSessionId: String?
|
||||
let live: Bool?
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case streamId, name, logoUrl, streamUrl, format
|
||||
case fallbackStreamUrl, fallbackFormat, drm, watchSessionId
|
||||
case eventId
|
||||
case eventId, live
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
|
|
@ -317,6 +326,7 @@ struct IptvPlayInfo: Decodable {
|
|||
fallbackFormat = try c.decodeIfPresent(String.self, forKey: .fallbackFormat)
|
||||
drm = try c.decodeIfPresent(DrmInfo.self, forKey: .drm)
|
||||
watchSessionId = try c.decodeIfPresent(String.self, forKey: .watchSessionId)
|
||||
live = try c.decodeIfPresent(Bool.self, forKey: .live)
|
||||
}
|
||||
|
||||
var clearKeyEntries: [ClearKeyEntry] {
|
||||
|
|
|
|||
Loading…
Reference in a new issue