mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-03 17:44:51 +02:00
Rewrite of object model to use Unrealm
This addresses issues with JSON serialization
This commit is contained in:
parent
0b46a9c9b1
commit
f6c43e479d
12 changed files with 297 additions and 662 deletions
|
@ -7,21 +7,17 @@
|
|||
|
||||
import Foundation
|
||||
import RealmSwift
|
||||
import Unrealm
|
||||
|
||||
class DeviceSettings: Object {
|
||||
@Persisted var disableAutoRewind: Bool
|
||||
@Persisted var enableAltView: Bool
|
||||
@Persisted var jumpBackwardsTime: Int
|
||||
@Persisted var jumpForwardTime: Int
|
||||
struct DeviceSettings: Realmable {
|
||||
var disableAutoRewind: Bool = false
|
||||
var enableAltView: Bool = false
|
||||
var jumpBackwardsTime: Int = 10
|
||||
var jumpForwardTime: Int = 10
|
||||
}
|
||||
|
||||
func getDefaultDeviceSettings() -> DeviceSettings {
|
||||
let settings = DeviceSettings()
|
||||
settings.disableAutoRewind = false
|
||||
settings.enableAltView = false
|
||||
settings.jumpForwardTime = 10
|
||||
settings.jumpBackwardsTime = 10
|
||||
return settings
|
||||
return DeviceSettings()
|
||||
}
|
||||
|
||||
func deviceSettingsToJSON(settings: DeviceSettings) -> Dictionary<String, Any> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue