mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-12 15:04:43 +02:00
Refactor storage model to work with native Realm
This commit is contained in:
parent
b0905d0270
commit
d83e04c47b
33 changed files with 1580 additions and 1305 deletions
|
@ -94,19 +94,3 @@ extension URL {
|
|||
return attributes?[.creationDate] as? Date
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - DAO Methods
|
||||
extension Object {
|
||||
func save() {
|
||||
let realm = try! Realm()
|
||||
try! realm.write {
|
||||
realm.add(self, update: .modified)
|
||||
}
|
||||
}
|
||||
|
||||
func update(handler: () -> Void?) {
|
||||
try! self.realm?.write {
|
||||
handler()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue