mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-05 02:25:45 +02:00
Add:iOS device settings for jump forward/backward
This commit is contained in:
parent
39b137c7f1
commit
b5c6acc2bc
11 changed files with 108 additions and 31 deletions
|
@ -128,4 +128,24 @@ class Database {
|
|||
return instance.objects(ServerConnectionConfigActiveIndex.self).first?.index ?? nil
|
||||
}
|
||||
}
|
||||
public func setDeviceSettings(deviceSettings: DeviceSettings) {
|
||||
Database.realmQueue.sync {
|
||||
let existing = instance.objects(DeviceSettings.self)
|
||||
|
||||
do {
|
||||
try instance.write {
|
||||
instance.delete(existing)
|
||||
instance.add(deviceSettings)
|
||||
}
|
||||
} catch(let exception) {
|
||||
NSLog("failed to save device settings")
|
||||
debugPrint(exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
public func getDeviceSettings() -> DeviceSettings {
|
||||
return Database.realmQueue.sync {
|
||||
return instance.objects(DeviceSettings.self).first ?? getDefaultDeviceSettings()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue