mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-12 15:04:43 +02:00
Fix data model issues
This commit is contained in:
parent
e275aa1699
commit
446e54cb91
6 changed files with 65 additions and 69 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue