New Data Classes

This commit is contained in:
benonymity 2022-04-22 20:31:45 -04:00
parent b72aba36b8
commit 4d0d1eb88f
3 changed files with 143 additions and 27 deletions

View file

@ -6,7 +6,7 @@
//
import Foundation
struct PlaybackSession: Decodable, Encodable {
var id: String
var userId: String?
@ -25,33 +25,8 @@ struct PlaybackSession: Decodable, Encodable {
var timeListening: Double
var audioTracks: [AudioTrack]
var currentTime: Double
// var libraryItem: LibraryItem?
var libraryItem: LibraryItem
// var localLibraryItem: LocalLibraryItem?
var serverConnectionConfigId: String?
var serverAddress: String?
}
struct Chapter: Decodable, Encodable {
var id: Int
var start: Double
var end: Double
var title: String?
}
struct AudioTrack: Decodable, Encodable {
var index: Int?
var startOffset: Double
var duration: Double
var title: String
var contentUrl: String
var mimeType: String
var metadata: FileMetadata?
// var isLocal: Bool
// var localFileId: String?
// var audioProbeResult: AudioProbeResult? Needed for local playback
var serverIndex: Int?
}
struct FileMetadata: Decodable, Encodable {
var filename: String
var ext: String
var path: String
var relPath: String
}