Grundcode AudiobookshelfClient

This commit is contained in:
Scarriffle
2026-05-14 19:24:52 +02:00
parent 7d0bc6466a
commit 652cfc4cf4
6 changed files with 495 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
import Foundation
// MARK: - Auth
struct LoginResponse: Codable {
let user: UserResponse
}
struct UserResponse: Codable {
let token: String
let id: String
}
// MARK: - Library
struct Library: Codable, Identifiable {
let id: String
let name: String
}
// MARK: - AudiobookItem
struct AudiobookItem: Identifiable {
let id: String
let title: String
let author: String
let coverURL: String?
let duration: Double
let mediaFiles: [MediaFile]
struct MediaFile {
let ino: String
let name: String
let path: String
}
}
// MARK: - Progress
struct LibraryProgress: Codable {
let currentTime: Double
let duration: Double?
let isFinished: Bool?
enum CodingKeys: String, CodingKey {
case currentTime
case duration
case isFinished
}
}