Skip to content

Commit

Permalink
Fix media composition parsing (#554)
Browse files Browse the repository at this point in the history
waliid authored Sep 4, 2023
1 parent b35bbf4 commit 07bec87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Sources/CoreBusiness/Model/Chapter.swift
Original file line number Diff line number Diff line change
@@ -11,13 +11,13 @@ public struct Chapter: Decodable {
enum CodingKeys: String, CodingKey {
case _analyticsData = "analyticsData"
case _analyticsMetadata = "analyticsMetadata"
case _resources = "resourceList"
case blockingReason = "blockReason"
case contentType = "type"
case date
case description
case endDate = "validTo"
case imageUrl
case resources = "resourceList"
case startDate = "validFrom"
case title
case urn
@@ -46,7 +46,9 @@ public struct Chapter: Decodable {
public let date: Date

/// The available resources.
public let resources: [Resource]
public var resources: [Resource] {
_resources ?? []
}

/// The date at which the content is made available.
public let startDate: Date?
@@ -68,6 +70,8 @@ public struct Chapter: Decodable {
private let _analyticsData: [String: String]?
// swiftlint:disable:next discouraged_optional_collection
private let _analyticsMetadata: [String: String]?
// swiftlint:disable:next discouraged_optional_collection
private let _resources: [Resource]?

/// Returns whether the content is blocked for some reason.
///

0 comments on commit 07bec87

Please sign in to comment.