2022-07-02 18:29:41 -05:00
|
|
|
//
|
|
|
|
// DeviceSettings.swift
|
|
|
|
// App
|
|
|
|
//
|
|
|
|
// Created by advplyr on 7/2/22.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import RealmSwift
|
|
|
|
|
2022-08-10 17:09:49 -04:00
|
|
|
class DeviceSettings: Object {
|
|
|
|
@Persisted var disableAutoRewind: Bool = false
|
|
|
|
@Persisted var enableAltView: Bool = false
|
|
|
|
@Persisted var jumpBackwardsTime: Int = 10
|
|
|
|
@Persisted var jumpForwardTime: Int = 10
|
2022-12-07 16:12:09 -06:00
|
|
|
@Persisted var lockOrientation: String = "NONE"
|
2022-07-02 18:29:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func getDefaultDeviceSettings() -> DeviceSettings {
|
2022-08-01 09:40:28 -04:00
|
|
|
return DeviceSettings()
|
2022-07-02 18:29:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func deviceSettingsToJSON(settings: DeviceSettings) -> Dictionary<String, Any> {
|
2022-08-07 17:46:13 -04:00
|
|
|
return [
|
|
|
|
"disableAutoRewind": settings.disableAutoRewind,
|
|
|
|
"enableAltView": settings.enableAltView,
|
|
|
|
"jumpBackwardsTime": settings.jumpBackwardsTime,
|
2022-12-04 10:41:09 -06:00
|
|
|
"jumpForwardTime": settings.jumpForwardTime,
|
|
|
|
"lockOrientation": settings.lockOrientation
|
2022-08-07 17:46:13 -04:00
|
|
|
]
|
2022-07-02 18:29:41 -05:00
|
|
|
}
|