Fix data model issues

This commit is contained in:
ronaldheft 2022-08-10 22:17:12 -04:00
parent e275aa1699
commit 446e54cb91
6 changed files with 65 additions and 69 deletions

View file

@ -199,8 +199,7 @@ struct AudioTrack: Realmable, Codable {
var contentUrl: String?
var mimeType: String
var metadata: FileMetadata?
// var isLocal: Bool
// var localFileId: String?
var localFileId: String?
// var audioProbeResult: AudioProbeResult? Needed for local playback
var serverIndex: Int?
@ -208,6 +207,13 @@ struct AudioTrack: Realmable, Codable {
duration = 0
mimeType = ""
}
mutating func setLocalInfo(filenameIdMap: [String: String], serverIndex: Int) {
if let localFileId = filenameIdMap[self.metadata?.filename ?? ""] {
self.localFileId = localFileId
self.serverIndex = serverIndex
}
}
}
struct FileMetadata: Realmable, Codable {