From e303dc4d37d662b1edfebf6e7d235f5cbbd32f2b Mon Sep 17 00:00:00 2001 From: Jos Vooges | STH Date: Mon, 28 Sep 2026 21:23:19 +0200 Subject: [PATCH] Add live flag to IptvPlayInfo so the Viaplay hub archive builds. --- apps/ios/VMC/Data/Models.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/ios/VMC/Data/Models.swift b/apps/ios/VMC/Data/Models.swift index aca32e8..d6f5f61 100644 --- a/apps/ios/VMC/Data/Models.swift +++ b/apps/ios/VMC/Data/Models.swift @@ -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] {