2023-08-12 16:01:27 -06:00
|
|
|
struct Chapter {
|
|
|
|
let title: String
|
2023-08-13 16:16:41 -06:00
|
|
|
let uri: String?
|
2023-08-12 16:01:27 -06:00
|
|
|
let startTime: Double
|
|
|
|
let endTime: Double
|
2023-12-07 00:47:40 -07:00
|
|
|
|
2023-08-12 16:01:27 -06:00
|
|
|
let json: NSDictionary?
|
2023-12-07 00:47:40 -07:00
|
|
|
|
2023-08-12 16:01:27 -06:00
|
|
|
init(_ json: NSDictionary!) {
|
|
|
|
guard json != nil else {
|
|
|
|
self.json = nil
|
|
|
|
self.title = ""
|
2023-08-13 16:16:41 -06:00
|
|
|
self.uri = nil
|
2023-08-12 16:01:27 -06:00
|
|
|
self.startTime = 0
|
|
|
|
self.endTime = 0
|
|
|
|
return
|
|
|
|
}
|
|
|
|
self.json = json
|
|
|
|
self.title = json["title"] as? String ?? ""
|
2023-08-13 16:16:41 -06:00
|
|
|
self.uri = json["uri"] as? String
|
2023-08-12 16:01:27 -06:00
|
|
|
self.startTime = json["startTime"] as? Double ?? 0
|
|
|
|
self.endTime = json["endTime"] as? Double ?? 0
|
|
|
|
}
|
|
|
|
}
|