Initialize auto rewind time and update description

This commit is contained in:
advplyr 2023-05-20 11:56:36 -05:00
parent 8061ac0ced
commit cb9e317e74
3 changed files with 14 additions and 10 deletions

View file

@ -126,7 +126,7 @@ data class DeviceSettings(
autoSleepTimerEndTime = "06:00", autoSleepTimerEndTime = "06:00",
sleepTimerLength = 900000L, // 15 minutes sleepTimerLength = 900000L, // 15 minutes
autoSleepTimerAutoRewind = false, autoSleepTimerAutoRewind = false,
autoSleepTimerAutoRewindTime = 300000L, autoSleepTimerAutoRewindTime = 300000L, // 5 minutes
disableSleepTimerFadeOut = false, disableSleepTimerFadeOut = false,
disableSleepTimerResetFeedback = false disableSleepTimerResetFeedback = false
) )

View file

@ -39,6 +39,10 @@ object DeviceManager {
if (deviceData.deviceSettings?.shakeSensitivity == null) { if (deviceData.deviceSettings?.shakeSensitivity == null) {
deviceData.deviceSettings?.shakeSensitivity = ShakeSensitivitySetting.MEDIUM deviceData.deviceSettings?.shakeSensitivity = ShakeSensitivitySetting.MEDIUM
} }
// Initialize auto sleep timer auto rewind added in v0.9.64
if (deviceData.deviceSettings?.autoSleepTimerAutoRewindTime == null) {
deviceData.deviceSettings?.autoSleepTimerAutoRewindTime = 300000L // 5 minutes
}
} }
fun getBase64Id(id:String):String { fun getBase64Id(id:String):String {

View file

@ -95,11 +95,11 @@
<ui-text-input :value="sleepTimerLengthOption" readonly append-icon="expand_more" style="width: 145px; max-width: 145px" /> <ui-text-input :value="sleepTimerLengthOption" readonly append-icon="expand_more" style="width: 145px; max-width: 145px" />
</div> </div>
</div> </div>
<div v-if="settings.autoSleepTimer" class="flex items-center py-3" @click="toggleAutoSleepTimerAutoRewind"> <div v-if="settings.autoSleepTimer" class="flex items-center py-3" @click="toggleAutoSleepTimerAutoRewind">
<div class="w-10 flex justify-center"> <div class="w-10 flex justify-center">
<ui-toggle-switch v-model="settings.autoSleepTimerAutoRewind" @input="saveSettings" /> <ui-toggle-switch v-model="settings.autoSleepTimerAutoRewind" @input="saveSettings" />
</div> </div>
<p class="pl-4">Auto Sleep Timer Auto Rewind</p> <p class="pl-4">Auto Sleep Timer Auto Rewind</p>
<span class="material-icons-outlined ml-2" @click.stop="showInfo('autoSleepTimerAutoRewind')">info</span> <span class="material-icons-outlined ml-2" @click.stop="showInfo('autoSleepTimerAutoRewind')">info</span>
</div> </div>
<div v-if="settings.autoSleepTimerAutoRewind" class="py-3 flex items-center"> <div v-if="settings.autoSleepTimerAutoRewind" class="py-3 flex items-center">
@ -142,7 +142,7 @@ export default {
disableSleepTimerFadeOut: false, disableSleepTimerFadeOut: false,
disableSleepTimerResetFeedback: false, disableSleepTimerResetFeedback: false,
autoSleepTimerAutoRewind: false, autoSleepTimerAutoRewind: false,
autoSleepTimerAutoRewindTime: 300000, // 5 minutes autoSleepTimerAutoRewindTime: 300000 // 5 minutes
}, },
lockCurrentOrientation: false, lockCurrentOrientation: false,
settingInfo: { settingInfo: {
@ -163,8 +163,8 @@ export default {
message: 'When the sleep timer gets reset your device will vibrate. Enable this setting to not vibrate when the sleep timer resets.' message: 'When the sleep timer gets reset your device will vibrate. Enable this setting to not vibrate when the sleep timer resets.'
}, },
autoSleepTimerAutoRewind: { autoSleepTimerAutoRewind: {
name: "Enable sleep timer auto rewind", name: 'Enable sleep timer auto rewind',
message: "When the Auto Sleep Timer plays, automatically rewind your position in the book. " message: 'When the auto sleep timer finishes, playing the item again will automatically rewind your position.'
} }
}, },
hapticFeedbackItems: [ hapticFeedbackItems: [
@ -402,7 +402,7 @@ export default {
this.settings.disableSleepTimerResetFeedback = !!deviceSettings.disableSleepTimerResetFeedback this.settings.disableSleepTimerResetFeedback = !!deviceSettings.disableSleepTimerResetFeedback
this.settings.autoSleepTimerAutoRewind = !!deviceSettings.autoSleepTimerAutoRewind this.settings.autoSleepTimerAutoRewind = !!deviceSettings.autoSleepTimerAutoRewind
this.settings.autoSleepTimerAutoRewindTime = !isNaN(deviceSettings.autoSleepTimerAutoRewindTime) ? deviceSettings.autoSleepTimerAutoRewindTime : 600000 // 10 minutes this.settings.autoSleepTimerAutoRewindTime = !isNaN(deviceSettings.autoSleepTimerAutoRewindTime) ? deviceSettings.autoSleepTimerAutoRewindTime : 300000 // 5 minutes
} }
}, },
mounted() { mounted() {