2022-07-02 23:29:41 +00:00
|
|
|
//
|
|
|
|
|
// DeviceSettings.swift
|
|
|
|
|
// App
|
|
|
|
|
//
|
|
|
|
|
// Created by advplyr on 7/2/22.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
import RealmSwift
|
|
|
|
|
|
2022-08-10 21:09:49 +00:00
|
|
|
class DeviceSettings: Object {
|
|
|
|
|
@Persisted var disableAutoRewind: Bool = false
|
2023-01-29 23:20:46 +00:00
|
|
|
@Persisted var enableAltView: Bool = true
|
2024-02-25 20:44:40 +00:00
|
|
|
@Persisted var allowSeekingOnMediaControls: Bool = false
|
2022-08-10 21:09:49 +00:00
|
|
|
@Persisted var jumpBackwardsTime: Int = 10
|
|
|
|
|
@Persisted var jumpForwardTime: Int = 10
|
2022-12-07 22:12:09 +00:00
|
|
|
@Persisted var lockOrientation: String = "NONE"
|
2023-01-08 21:32:15 +00:00
|
|
|
@Persisted var hapticFeedback: String = "LIGHT"
|
2023-12-03 23:37:01 +00:00
|
|
|
@Persisted var languageCode: String = "en-us"
|
2022-07-02 23:29:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func getDefaultDeviceSettings() -> DeviceSettings {
|
2022-08-01 13:40:28 +00:00
|
|
|
return DeviceSettings()
|
2022-07-02 23:29:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func deviceSettingsToJSON(settings: DeviceSettings) -> Dictionary<String, Any> {
|
2022-08-07 21:46:13 +00:00
|
|
|
return [
|
|
|
|
|
"disableAutoRewind": settings.disableAutoRewind,
|
|
|
|
|
"enableAltView": settings.enableAltView,
|
2024-02-25 20:44:40 +00:00
|
|
|
"allowSeekingOnMediaControls": settings.allowSeekingOnMediaControls,
|
2022-08-07 21:46:13 +00:00
|
|
|
"jumpBackwardsTime": settings.jumpBackwardsTime,
|
2022-12-04 16:41:09 +00:00
|
|
|
"jumpForwardTime": settings.jumpForwardTime,
|
2023-01-08 21:32:15 +00:00
|
|
|
"lockOrientation": settings.lockOrientation,
|
2023-12-03 23:37:01 +00:00
|
|
|
"hapticFeedback": settings.hapticFeedback,
|
|
|
|
|
"languageCode": settings.languageCode
|
2022-08-07 21:46:13 +00:00
|
|
|
]
|
2022-07-02 23:29:41 +00:00
|
|
|
}
|