mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 10:04:39 +02:00
Prototype response to app
This commit is contained in:
parent
175e642081
commit
b7725c455b
3 changed files with 41 additions and 13 deletions
|
@ -9,7 +9,7 @@ import Foundation
|
|||
import RealmSwift
|
||||
|
||||
|
||||
class LocalLibraryItem: Object {
|
||||
class LocalLibraryItem: Object, Encodable {
|
||||
@Persisted(primaryKey: true) var id: String
|
||||
@Persisted var basePath: String = ""
|
||||
@Persisted var absolutePath: String = ""
|
||||
|
@ -44,6 +44,15 @@ class LocalLibraryItem: Object {
|
|||
self.serverAddress = server.address
|
||||
self.serverUserId = server.userId
|
||||
}
|
||||
|
||||
enum CodingKeys: CodingKey {
|
||||
case id
|
||||
}
|
||||
|
||||
func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||
try container.encode(id, forKey: .id)
|
||||
}
|
||||
}
|
||||
|
||||
class LocalMediaType: Object {
|
||||
|
@ -146,7 +155,7 @@ class LocalPodcastEpisode: Object {
|
|||
// @Persisted var serverEpisodeId: String?
|
||||
}
|
||||
|
||||
class LocalAudioFile: Object, Codable {
|
||||
class LocalAudioFile: Object {
|
||||
@Persisted var index: Int
|
||||
@Persisted var ino: String
|
||||
@Persisted var metadata: LocalFileMetadata?
|
||||
|
@ -162,13 +171,13 @@ class LocalAudioFile: Object, Codable {
|
|||
}
|
||||
}
|
||||
|
||||
class LocalAuthor: Object, Codable {
|
||||
class LocalAuthor: Object {
|
||||
@Persisted var id: String
|
||||
@Persisted var name: String
|
||||
@Persisted var coverPath: String? = ""
|
||||
}
|
||||
|
||||
class LocalChapter: Object, Codable {
|
||||
class LocalChapter: Object {
|
||||
@Persisted var id: Int
|
||||
@Persisted var start: Double
|
||||
@Persisted var end: Double
|
||||
|
@ -216,7 +225,7 @@ class LocalAudioTrack: Object {
|
|||
}
|
||||
}
|
||||
|
||||
class LocalFileMetadata: Object, Codable {
|
||||
class LocalFileMetadata: Object {
|
||||
@Persisted var filename: String
|
||||
@Persisted var ext: String
|
||||
@Persisted var path: String
|
||||
|
@ -248,7 +257,7 @@ class LocalFile: Object {
|
|||
}
|
||||
}
|
||||
|
||||
class LocalMediaProgress: Object, Codable {
|
||||
class LocalMediaProgress: Object {
|
||||
@Persisted var id: String
|
||||
@Persisted var localLibraryItemId: String
|
||||
@Persisted var localEpisodeId: String? = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue