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
|
2023-01-29 17:20:46 -06:00
|
|
|
@Persisted var enableAltView: Bool = true
|
2024-02-20 22:08:47 +01:00
|
|
|
@Persisted var allowSeekingOnWidget: Bool = false
|
2022-08-10 17:09:49 -04:00
|
|
|
@Persisted var jumpBackwardsTime: Int = 10
|
|
|
|
@Persisted var jumpForwardTime: Int = 10
|
2022-12-07 16:12:09 -06:00
|
|
|
@Persisted var lockOrientation: String = "NONE"
|
2023-01-08 15:32:15 -06:00
|
|
|
@Persisted var hapticFeedback: String = "LIGHT"
|
2023-12-03 17:37:01 -06:00
|
|
|
@Persisted var languageCode: String = "en-us"
|
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,
|
2024-02-20 21:58:31 +01:00
|
|
|
"allowSeekingOnWidget": settings.allowSeekingOnWidget,
|
2022-08-07 17:46:13 -04:00
|
|
|
"jumpBackwardsTime": settings.jumpBackwardsTime,
|
2022-12-04 10:41:09 -06:00
|
|
|
"jumpForwardTime": settings.jumpForwardTime,
|
2023-01-08 15:32:15 -06:00
|
|
|
"lockOrientation": settings.lockOrientation,
|
2023-12-03 17:37:01 -06:00
|
|
|
"hapticFeedback": settings.hapticFeedback,
|
|
|
|
"languageCode": settings.languageCode
|
2022-08-07 17:46:13 -04:00
|
|
|
]
|
2022-07-02 18:29:41 -05:00
|
|
|
}
|