diff --git a/components/app/AudioPlayer.vue b/components/app/AudioPlayer.vue index ec129319..01b29256 100644 --- a/components/app/AudioPlayer.vue +++ b/components/app/AudioPlayer.vue @@ -99,7 +99,7 @@ - + @@ -146,6 +146,7 @@ export default { useChapterTrack: false, useTotalTrack: true, scaleElapsedTimeBySpeed: true, + useChapterDuration: false, lockUi: false }, isLoading: false, @@ -206,6 +207,11 @@ export default { value: 'scale_elapsed_time', icon: this.playerSettings.scaleElapsedTimeBySpeed ? 'check_box' : 'check_box_outline_blank' }, + { + text: this.$strings.LabelUseChapterDuration, + value: 'use_chapter_duration', + icon: this.playerSettings.useChapterDuration ? 'check_box' : 'check_box_outline_blank' + }, { text: this.playerSettings.lockUi ? this.$strings.LabelUnlockPlayer : this.$strings.LabelLockPlayer, value: 'lock', @@ -732,6 +738,9 @@ export default { this.playerSettings.scaleElapsedTimeBySpeed = !this.playerSettings.scaleElapsedTimeBySpeed this.updateTimestamp() this.savePlayerSettings() + } else if (action === 'use_chapter_duration') { + this.playerSettings.useChapterDuration = !this.playerSettings.useChapterDuration + this.savePlayerSettings() } else if (action === 'lock') { this.playerSettings.lockUi = !this.playerSettings.lockUi this.savePlayerSettings() @@ -799,6 +808,7 @@ export default { this.playerSettings.useTotalTrack = !!savedPlayerSettings.useTotalTrack this.playerSettings.lockUi = !!savedPlayerSettings.lockUi this.playerSettings.scaleElapsedTimeBySpeed = !!savedPlayerSettings.scaleElapsedTimeBySpeed + this.playerSettings.useChapterDuration = !!savedPlayerSettings.useChapterDuration } }, savePlayerSettings() { diff --git a/components/modals/ChaptersModal.vue b/components/modals/ChaptersModal.vue index 7ba356d8..c2cf1c72 100644 --- a/components/modals/ChaptersModal.vue +++ b/components/modals/ChaptersModal.vue @@ -14,7 +14,7 @@

{{ chapter.title }}

- {{ $secondsToTimestamp(chapter.start / _playbackRate) }} + {{ $secondsToTimestamp(((useChapterDuration ? Math.max(0, chapter.end - chapter.start) : chapter.start) / _playbackRate)) }}
@@ -39,7 +39,8 @@ export default { type: Object, default: () => null }, - playbackRate: Number + playbackRate: Number, + useChapterDuration: Boolean }, data() { return {} diff --git a/strings/en-us.json b/strings/en-us.json index fdfd87f8..c09c5547 100644 --- a/strings/en-us.json +++ b/strings/en-us.json @@ -272,6 +272,7 @@ "LabelUnknown": "Unknown", "LabelUnlockPlayer": "Unlock Player", "LabelUseBookshelfView": "Use bookshelf view", + "LabelUseChapterDuration": "Use chapter duration", "LabelUser": "User", "LabelUsername": "Username", "LabelVeryHigh": "Very High",