mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-05 02:25:45 +02:00
Add:Device setting for locking screen orientation #449
This commit is contained in:
parent
af216d9b38
commit
9687f47b6b
12 changed files with 100 additions and 7 deletions
|
@ -8,11 +8,18 @@
|
|||
import Foundation
|
||||
import RealmSwift
|
||||
|
||||
enum LockOrientationSetting: Codable {
|
||||
case NONE
|
||||
case PORTRAIT
|
||||
case LANDSCAPE
|
||||
}
|
||||
|
||||
class DeviceSettings: Object {
|
||||
@Persisted var disableAutoRewind: Bool = false
|
||||
@Persisted var enableAltView: Bool = false
|
||||
@Persisted var jumpBackwardsTime: Int = 10
|
||||
@Persisted var jumpForwardTime: Int = 10
|
||||
@Persisted var lockOrientation: LockOrientationSetting = LockOrientationSetting.NONE
|
||||
}
|
||||
|
||||
func getDefaultDeviceSettings() -> DeviceSettings {
|
||||
|
@ -24,6 +31,7 @@ func deviceSettingsToJSON(settings: DeviceSettings) -> Dictionary<String, Any> {
|
|||
"disableAutoRewind": settings.disableAutoRewind,
|
||||
"enableAltView": settings.enableAltView,
|
||||
"jumpBackwardsTime": settings.jumpBackwardsTime,
|
||||
"jumpForwardTime": settings.jumpForwardTime
|
||||
"jumpForwardTime": settings.jumpForwardTime,
|
||||
"lockOrientation": settings.lockOrientation
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue