This commit is contained in:
douboer
2025-09-07 12:39:28 +08:00
parent 1ba01e3c64
commit 4d033257fe
5714 changed files with 15866 additions and 1032 deletions

View File

@@ -0,0 +1,50 @@
import Foundation
struct BookMeta: Identifiable, Codable {
let id: String
let title: String
let author: String
let type: String
let last_open: Double? // Unix
let readtime30d: [Int]?
let readtime12m: [Int]?
let readtime_year: Int?
let is_finished_this_year: Bool?
}
struct AnnotationRow: Identifiable, Codable {
let id: String // uuid
let creationdate: String?
let idref: String?
let filepos: String?
let selected: String?
let note: String?
init(uuid: String, creationdate: String?, idref: String?, filepos: String?, selected: String?, note: String?) {
self.id = uuid
self.creationdate = creationdate
self.idref = idref
self.filepos = filepos
self.selected = selected
self.note = note
}
}
struct StatsGlobal: Codable {
let year_total_minutes: Int
let month_avg_minutes: Int
let week_total_minutes: Int
let day_avg_minutes: Int
let finished_books_count: Int
}
struct StatsPayload: Codable {
let generated_at: String?
let global: StatsGlobal
}
struct BundleIndex {
let books: [BookMeta]
let stats: StatsPayload
let bookIntro: [String:String]
let annotationsMap: [String:[AnnotationRow]]
}