mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-29 23:25:47 +02:00
Add: Sleep Timer set to end of chapter #24, Change: Scroll to current chapter in modal
This commit is contained in:
parent
3b462b27b5
commit
082c303caf
9 changed files with 134 additions and 41 deletions
|
@ -13,8 +13,8 @@ android {
|
||||||
applicationId "com.audiobookshelf.app"
|
applicationId "com.audiobookshelf.app"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 30
|
versionCode 31
|
||||||
versionName "0.9.14-beta"
|
versionName "0.9.15-beta"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||||
|
|
|
@ -123,8 +123,8 @@ class MainActivity : BridgeActivity() {
|
||||||
storageHelper.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
storageHelper.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onUserInteraction() {
|
// override fun onUserInteraction() {
|
||||||
super.onUserInteraction()
|
// super.onUserInteraction()
|
||||||
Log.d(tag, "USER INTERACTION")
|
// Log.d(tag, "USER INTERACTION")
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,8 @@ class MyNativeAudio : Plugin() {
|
||||||
jsobj.put("playWhenReady", playWhenReady)
|
jsobj.put("playWhenReady", playWhenReady)
|
||||||
notifyListeners("onPrepareMedia", jsobj)
|
notifyListeners("onPrepareMedia", jsobj)
|
||||||
}
|
}
|
||||||
override fun onSleepTimerEnded() {
|
override fun onSleepTimerEnded(currentPosition:Long) {
|
||||||
emit("onSleepTimerEnded", true)
|
emit("onSleepTimerEnded", currentPosition)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -209,10 +209,15 @@ class MyNativeAudio : Plugin() {
|
||||||
|
|
||||||
@PluginMethod
|
@PluginMethod
|
||||||
fun setSleepTimer(call: PluginCall) {
|
fun setSleepTimer(call: PluginCall) {
|
||||||
var sleepTimeout:Long = call.getString("timeout", "360000")!!.toLong()
|
var time:Long = call.getString("time", "360000")!!.toLong()
|
||||||
|
var isChapterTime:Boolean = call.getBoolean("isChapterTime", false) == true
|
||||||
|
|
||||||
playerNotificationService.setSleepTimer(sleepTimeout)
|
Handler(Looper.getMainLooper()).post() {
|
||||||
call.resolve()
|
var success:Boolean = playerNotificationService.setSleepTimer(time, isChapterTime)
|
||||||
|
val ret = JSObject()
|
||||||
|
ret.put("success", success)
|
||||||
|
call.resolve(ret)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@PluginMethod
|
@PluginMethod
|
||||||
|
|
|
@ -51,7 +51,7 @@ class PlayerNotificationService : MediaBrowserServiceCompat() {
|
||||||
fun onPlayingUpdate(isPlaying: Boolean)
|
fun onPlayingUpdate(isPlaying: Boolean)
|
||||||
fun onMetadata(metadata: JSObject)
|
fun onMetadata(metadata: JSObject)
|
||||||
fun onPrepare(audiobookId:String, playWhenReady:Boolean)
|
fun onPrepare(audiobookId:String, playWhenReady:Boolean)
|
||||||
fun onSleepTimerEnded()
|
fun onSleepTimerEnded(currentPosition:Long)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val tag = "PlayerService"
|
private val tag = "PlayerService"
|
||||||
|
@ -86,6 +86,7 @@ class PlayerNotificationService : MediaBrowserServiceCompat() {
|
||||||
private var onSeekBack: Boolean = false
|
private var onSeekBack: Boolean = false
|
||||||
|
|
||||||
private var sleepTimerTask:TimerTask? = null
|
private var sleepTimerTask:TimerTask? = null
|
||||||
|
private var sleepChapterTime:Long = 0L
|
||||||
|
|
||||||
fun setCustomObjectListener(mylistener: MyCustomObjectListener) {
|
fun setCustomObjectListener(mylistener: MyCustomObjectListener) {
|
||||||
listener = mylistener
|
listener = mylistener
|
||||||
|
@ -722,20 +723,45 @@ class PlayerNotificationService : MediaBrowserServiceCompat() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setSleepTimer(timeout:Long) {
|
fun setSleepTimer(time:Long, isChapterTime:Boolean) : Boolean {
|
||||||
Log.d(tag, "Setting Sleep Timer for $timeout")
|
Log.d(tag, "Setting Sleep Timer for $time is chapter time $isChapterTime")
|
||||||
|
|
||||||
sleepTimerTask?.cancel()
|
sleepTimerTask?.cancel()
|
||||||
sleepTimerTask = Timer("SleepTimer",false).schedule(timeout) {
|
sleepChapterTime = 0L
|
||||||
Log.d(tag, "Sleep Timer Done")
|
|
||||||
Handler(Looper.getMainLooper()).post() {
|
if (isChapterTime) {
|
||||||
if (mPlayer.isPlaying) {
|
// Validate time
|
||||||
Log.d(tag, "Sleep Timer Pausing Player")
|
if (mPlayer.isPlaying) {
|
||||||
mPlayer.pause()
|
if (mPlayer.currentPosition >= time) {
|
||||||
|
Log.d(tag, "Invalid setSleepTimer chapter time is already passed")
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sleepChapterTime = time
|
||||||
|
sleepTimerTask = Timer("SleepTimer",false).schedule(0L, 1000L) {
|
||||||
|
Handler(Looper.getMainLooper()).post() {
|
||||||
|
if (mPlayer.isPlaying && mPlayer.currentPosition > sleepChapterTime) {
|
||||||
|
Log.d(tag, "Sleep Timer Pausing Player on Chapter")
|
||||||
|
mPlayer.pause()
|
||||||
|
|
||||||
|
if (listener != null) listener.onSleepTimerEnded(mPlayer.currentPosition)
|
||||||
|
sleepTimerTask?.cancel()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sleepTimerTask = Timer("SleepTimer",false).schedule(time) {
|
||||||
|
Log.d(tag, "Sleep Timer Done")
|
||||||
|
Handler(Looper.getMainLooper()).post() {
|
||||||
|
if (mPlayer.isPlaying) {
|
||||||
|
Log.d(tag, "Sleep Timer Pausing Player")
|
||||||
|
mPlayer.pause()
|
||||||
|
}
|
||||||
|
if (listener != null) listener.onSleepTimerEnded(mPlayer.currentPosition)
|
||||||
}
|
}
|
||||||
if (listener != null) listener.onSleepTimerEnded()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getSleepTimerTime():Long? {
|
fun getSleepTimerTime():Long? {
|
||||||
|
@ -748,6 +774,7 @@ class PlayerNotificationService : MediaBrowserServiceCompat() {
|
||||||
Log.d(tag, "Canceling Sleep Timer")
|
Log.d(tag, "Canceling Sleep Timer")
|
||||||
sleepTimerTask?.cancel()
|
sleepTimerTask?.cancel()
|
||||||
sleepTimerTask = null
|
sleepTimerTask = null
|
||||||
|
sleepChapterTime = 0L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,8 @@
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
|
||||||
</svg>
|
</svg>
|
||||||
<div v-else class="h-5 w-5 flex items-center justify-around">
|
<div v-else class="h-5 w-5 flex items-center justify-around">
|
||||||
<p class="text-sm font-mono text-warning">{{ Math.ceil(sleepTimeoutCurrentTime / 1000 / 60) }}m</p>
|
<p v-if="sleepTimerEndOfChapterTime" class="text-sm font-mono text-warning">EOC</p>
|
||||||
|
<p v-else class="text-sm font-mono text-warning">{{ Math.ceil(sleepTimeoutCurrentTime / 1000 / 60) }}m</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -65,7 +66,8 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
sleepTimerRunning: Boolean,
|
sleepTimerRunning: Boolean,
|
||||||
sleepTimeoutCurrentTime: Number
|
sleepTimeoutCurrentTime: Number,
|
||||||
|
sleepTimerEndOfChapterTime: Number
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -15,11 +15,13 @@
|
||||||
<div class="absolute left-2 -top-10 bookCoverWrapper">
|
<div class="absolute left-2 -top-10 bookCoverWrapper">
|
||||||
<cards-book-cover :audiobook="audiobook" :download-cover="downloadedCover" :width="64" />
|
<cards-book-cover :audiobook="audiobook" :download-cover="downloadedCover" :width="64" />
|
||||||
</div>
|
</div>
|
||||||
<audio-player-mini ref="audioPlayerMini" :loading="isLoading" :sleep-timer-running="isSleepTimerRunning" :sleep-timeout-current-time="sleepTimeoutCurrentTime" @updateTime="updateTime" @selectPlaybackSpeed="showPlaybackSpeedModal = true" @showSleepTimer="showSleepTimer" @hook:mounted="audioPlayerMounted" />
|
<audio-player-mini ref="audioPlayerMini" :loading="isLoading" :sleep-timer-running="isSleepTimerRunning" :sleep-timer-end-of-chapter-time="sleepTimerEndOfChapterTime" :sleep-timeout-current-time="sleepTimeoutCurrentTime" @updateTime="updateTime" @selectPlaybackSpeed="showPlaybackSpeedModal = true" @showSleepTimer="showSleepTimer" @hook:mounted="audioPlayerMounted" />
|
||||||
</div>
|
</div>
|
||||||
<modals-playback-speed-modal v-model="showPlaybackSpeedModal" :playback-speed.sync="playbackSpeed" @change="changePlaybackSpeed" />
|
<modals-playback-speed-modal v-model="showPlaybackSpeedModal" :playback-speed.sync="playbackSpeed" @change="changePlaybackSpeed" />
|
||||||
|
|
||||||
<modals-chapters-modal v-model="showChapterModal" :current-chapter="currentChapter" :chapters="chapters" @select="selectChapter" />
|
<modals-chapters-modal v-model="showChapterModal" :current-chapter="currentChapter" :chapters="chapters" @select="selectChapter" />
|
||||||
<modals-sleep-timer-modal v-model="showSleepTimerModal" :current-time="sleepTimeoutCurrentTime" :sleep-timer-running="isSleepTimerRunning" @change="selectSleepTimeout" @cancel="cancelSleepTimer" />
|
|
||||||
|
<modals-sleep-timer-modal v-model="showSleepTimerModal" :current-time="sleepTimeoutCurrentTime" :sleep-timer-running="isSleepTimerRunning" :current-end-of-chapter-time="currentEndOfChapterTime" :end-of-chapter-time-set="sleepTimerEndOfChapterTime" @change="selectSleepTimeout" @cancel="cancelSleepTimer" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -41,8 +43,10 @@ export default {
|
||||||
currentTime: 0,
|
currentTime: 0,
|
||||||
sleepTimeoutCurrentTime: 0,
|
sleepTimeoutCurrentTime: 0,
|
||||||
isSleepTimerRunning: false,
|
isSleepTimerRunning: false,
|
||||||
|
sleepTimerEndOfChapterTime: false,
|
||||||
onSleepTimerEndedListener: null,
|
onSleepTimerEndedListener: null,
|
||||||
sleepInterval: null
|
sleepInterval: null,
|
||||||
|
currentEndOfChapterTime: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -124,12 +128,22 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onSleepTimerEnded() {
|
onSleepTimerEnded({ value: currentPosition }) {
|
||||||
this.isSleepTimerRunning = false
|
this.isSleepTimerRunning = false
|
||||||
if (this.sleepInterval) clearInterval(this.sleepInterval)
|
if (this.sleepInterval) clearInterval(this.sleepInterval)
|
||||||
|
|
||||||
|
if (currentPosition) {
|
||||||
|
console.log('Sleep Timer Ended Current Position: ' + currentPosition)
|
||||||
|
var currentTime = Math.floor(currentPosition / 1000)
|
||||||
|
this.updateTime(currentTime)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
showSleepTimer() {
|
showSleepTimer() {
|
||||||
this.getSleepTimerTime()
|
if (this.currentChapter) {
|
||||||
|
this.currentEndOfChapterTime = Math.floor(this.currentChapter.end)
|
||||||
|
} else {
|
||||||
|
this.currentEndOfChapterTime = 0
|
||||||
|
}
|
||||||
this.showSleepTimerModal = true
|
this.showSleepTimerModal = true
|
||||||
},
|
},
|
||||||
async getSleepTimerTime() {
|
async getSleepTimerTime() {
|
||||||
|
@ -140,15 +154,25 @@ export default {
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
},
|
},
|
||||||
async selectSleepTimeout(timeout) {
|
async selectSleepTimeout({ time, isChapterTime }) {
|
||||||
console.log('Setting sleep timer', timeout)
|
console.log('Setting sleep timer', time, isChapterTime)
|
||||||
await MyNativeAudio.setSleepTimer({ timeout: String(timeout) })
|
var res = await MyNativeAudio.setSleepTimer({ time: String(time), isChapterTime })
|
||||||
this.setSleepTimeoutTimer(timeout)
|
if (!res.success) {
|
||||||
|
return this.$toast.error('Sleep timer did not set, invalid time')
|
||||||
|
}
|
||||||
|
if (isChapterTime) {
|
||||||
|
this.sleepTimerEndOfChapterTime = time
|
||||||
|
this.isSleepTimerRunning = true
|
||||||
|
} else {
|
||||||
|
this.sleepTimerEndOfChapterTime = 0
|
||||||
|
this.setSleepTimeoutTimer(time)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async cancelSleepTimer() {
|
async cancelSleepTimer() {
|
||||||
console.log('Canceling sleep timer')
|
console.log('Canceling sleep timer')
|
||||||
await MyNativeAudio.cancelSleepTimer()
|
await MyNativeAudio.cancelSleepTimer()
|
||||||
this.isSleepTimerRunning = false
|
this.isSleepTimerRunning = false
|
||||||
|
this.sleepTimerEndOfChapterTime = 0
|
||||||
if (this.sleepInterval) clearInterval(this.sleepInterval)
|
if (this.sleepInterval) clearInterval(this.sleepInterval)
|
||||||
},
|
},
|
||||||
async syncSleepTimer() {
|
async syncSleepTimer() {
|
||||||
|
|
|
@ -7,15 +7,17 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="w-full h-full overflow-hidden absolute top-0 left-0 flex items-center justify-center" @click="show = false">
|
<div class="w-full h-full overflow-hidden absolute top-0 left-0 flex items-center justify-center" @click="show = false">
|
||||||
<div class="w-full overflow-x-hidden overflow-y-auto bg-primary rounded-lg border border-white border-opacity-20" style="max-height: 75%" @click.stop>
|
<div ref="container" class="w-full overflow-x-hidden overflow-y-auto bg-primary rounded-lg border border-white border-opacity-20" style="max-height: 75%" @click.stop>
|
||||||
<ul class="h-full w-full" role="listbox" aria-labelledby="listbox-label">
|
<ul class="h-full w-full" role="listbox" aria-labelledby="listbox-label">
|
||||||
<template v-for="chapter in chapters">
|
<template v-for="chapter in chapters">
|
||||||
<li :key="chapter.id" class="text-gray-50 select-none relative py-3 cursor-pointer hover:bg-black-400" :class="currentChapterId === chapter.id ? 'bg-bg bg-opacity-80' : ''" role="option" @click="clickedOption(chapter)">
|
<li :key="chapter.id" :id="`chapter-row-${chapter.id}`" class="text-gray-50 select-none relative py-3 cursor-pointer hover:bg-black-400" :class="currentChapterId === chapter.id ? 'bg-bg bg-opacity-80' : ''" role="option" @click="clickedOption(chapter)">
|
||||||
<div class="flex items-center justify-center px-3">
|
<div class="flex items-center justify-center px-3">
|
||||||
<span class="font-normal block truncate text-lg">{{ chapter.title }}</span>
|
<span class="font-normal block truncate text-lg">{{ chapter.title }}</span>
|
||||||
<div class="flex-grow" />
|
<div class="flex-grow" />
|
||||||
<span class="font-mono text-gray-300">{{ $secondsToTimestamp(chapter.start) }}</span>
|
<span class="font-mono text-gray-300">{{ $secondsToTimestamp(chapter.start) }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-show="chapter.id === currentChapterId" class="w-0.5 h-full absolute top-0 left-0 bg-yellow-400" />
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -40,6 +42,11 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
value(newVal) {
|
||||||
|
this.$nextTick(this.scrollToChapter)
|
||||||
|
}
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
show: {
|
show: {
|
||||||
get() {
|
get() {
|
||||||
|
@ -59,6 +66,19 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
clickedOption(chapter) {
|
clickedOption(chapter) {
|
||||||
this.$emit('select', chapter)
|
this.$emit('select', chapter)
|
||||||
|
},
|
||||||
|
scrollToChapter() {
|
||||||
|
if (!this.currentChapterId) return
|
||||||
|
|
||||||
|
var container = this.$refs.container
|
||||||
|
if (container) {
|
||||||
|
var currChapterEl = document.getElementById(`chapter-row-${this.currentChapterId}`)
|
||||||
|
if (currChapterEl) {
|
||||||
|
var offsetTop = currChapterEl.offsetTop
|
||||||
|
var containerHeight = container.clientHeight
|
||||||
|
container.scrollTo({ top: offsetTop - containerHeight / 2 })
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {}
|
mounted() {}
|
||||||
|
|
|
@ -10,15 +10,21 @@
|
||||||
<div class="w-full overflow-x-hidden overflow-y-auto bg-primary rounded-lg border border-white border-opacity-20" style="max-height: 75%" @click.stop>
|
<div class="w-full overflow-x-hidden overflow-y-auto bg-primary rounded-lg border border-white border-opacity-20" style="max-height: 75%" @click.stop>
|
||||||
<ul v-if="!sleepTimerRunning" class="h-full w-full" role="listbox" aria-labelledby="listbox-label">
|
<ul v-if="!sleepTimerRunning" class="h-full w-full" role="listbox" aria-labelledby="listbox-label">
|
||||||
<template v-for="timeout in timeouts">
|
<template v-for="timeout in timeouts">
|
||||||
<li :key="timeout" class="text-gray-50 select-none relative py-4 pr-9 cursor-pointer hover:bg-black-400" role="option" @click="clickedOption(timeout)">
|
<li :key="timeout" class="text-gray-50 select-none relative py-4 cursor-pointer hover:bg-black-400" role="option" @click="clickedOption(timeout)">
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<span class="font-normal ml-3 block truncate text-lg">{{ timeout }} min</span>
|
<span class="font-normal block truncate text-lg">{{ timeout }} min</span>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
|
<li v-if="currentEndOfChapterTime" class="text-gray-50 select-none relative py-4 cursor-pointer hover:bg-black-400" role="option" @click="clickedChapterOption(timeout)">
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<span class="font-normal block truncate text-lg text-center">End of Chapter</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div v-else class="px-2 py-4">
|
<div v-else class="px-2 py-4">
|
||||||
<p class="mb-4 text-2xl font-mono text-center">{{ timeRemainingPretty }}</p>
|
<p v-if="endOfChapterTimeSet" class="mb-4 text-2xl font-mono text-center">EOC: {{ endOfChapterTimePretty }}</p>
|
||||||
|
<p v-else class="mb-4 text-2xl font-mono text-center">{{ timeRemainingPretty }}</p>
|
||||||
<ui-btn @click="cancelSleepTimer" class="w-full">Cancel Timer</ui-btn>
|
<ui-btn @click="cancelSleepTimer" class="w-full">Cancel Timer</ui-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -31,7 +37,9 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
value: Boolean,
|
value: Boolean,
|
||||||
currentTime: Number,
|
currentTime: Number,
|
||||||
sleepTimerRunning: Boolean
|
sleepTimerRunning: Boolean,
|
||||||
|
currentEndOfChapterTime: Boolean,
|
||||||
|
endOfChapterTimeSet: Number
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {}
|
return {}
|
||||||
|
@ -50,13 +58,20 @@ export default {
|
||||||
},
|
},
|
||||||
timeRemainingPretty() {
|
timeRemainingPretty() {
|
||||||
return this.$secondsToTimestamp(this.currentTime / 1000)
|
return this.$secondsToTimestamp(this.currentTime / 1000)
|
||||||
|
},
|
||||||
|
endOfChapterTimePretty() {
|
||||||
|
return this.$secondsToTimestamp(this.endOfChapterTimeSet / 1000)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
clickedChapterOption() {
|
||||||
|
this.show = false
|
||||||
|
this.$nextTick(() => this.$emit('change', { time: this.currentEndOfChapterTime * 1000, isChapterTime: true }))
|
||||||
|
},
|
||||||
clickedOption(timeoutMin) {
|
clickedOption(timeoutMin) {
|
||||||
var timeout = timeoutMin * 1000 * 60
|
var timeout = timeoutMin * 1000 * 60
|
||||||
this.show = false
|
this.show = false
|
||||||
this.$nextTick(() => this.$emit('change', timeout))
|
this.$nextTick(() => this.$emit('change', { time: timeout, isChapterTime: false }))
|
||||||
},
|
},
|
||||||
cancelSleepTimer() {
|
cancelSleepTimer() {
|
||||||
this.$emit('cancel')
|
this.$emit('cancel')
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "audiobookshelf-app",
|
"name": "audiobookshelf-app",
|
||||||
"version": "v0.9.14-beta",
|
"version": "v0.9.15-beta",
|
||||||
"author": "advplyr",
|
"author": "advplyr",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nuxt --hostname localhost --port 1337",
|
"dev": "nuxt --hostname localhost --port 1337",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue