mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-12 12:21:34 +00:00
Add playback settings UI for jump forwards and jump backwards
This commit is contained in:
parent
039834b676
commit
e5a8430765
1 changed files with 41 additions and 0 deletions
|
|
@ -94,6 +94,29 @@
|
||||||
</p>
|
</p>
|
||||||
</ui-tooltip>
|
</ui-tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="pt-4">
|
||||||
|
<h2 class="font-semibold">{{ $strings.HeaderSettingsPlayback }}</h2>
|
||||||
|
</div>
|
||||||
|
<div class="flex items-center py-2">
|
||||||
|
<ui-icon-btn @click="toggleJumpBackwards" :icon="currentJumpBackwardsIcon" iconFontSize="35px" :size="50" />
|
||||||
|
<ui-tooltip :text="$strings.LabelSettingsJumpBackwardsTimeHelp">
|
||||||
|
<p class="pl-4">
|
||||||
|
<span id="settings-jump-backwards-time">{{ $strings.LabelSettingsJumpBackwardsTime }}</span>
|
||||||
|
<span class="material-icons icon-text">info_outlined</span>
|
||||||
|
</p>
|
||||||
|
</ui-tooltip>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center py-2">
|
||||||
|
<ui-icon-btn @click="toggleJumpForwards" :icon="currentJumpForwardsIcon" iconFontSize="35px" :size="50" />
|
||||||
|
<ui-tooltip :text="$strings.LabelSettingsJumpForwardsTimeHelp">
|
||||||
|
<p class="pl-4">
|
||||||
|
<span id="settings-jump-forwards-time">{{ $strings.LabelSettingsJumpForwardsTime }}</span>
|
||||||
|
<span class="material-icons icon-text">info_outlined</span>
|
||||||
|
</p>
|
||||||
|
</ui-tooltip>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
|
|
@ -228,6 +251,12 @@ export default {
|
||||||
homepageUseBookshelfView: false,
|
homepageUseBookshelfView: false,
|
||||||
useBookshelfView: false,
|
useBookshelfView: false,
|
||||||
scannerEnableWatcher: false,
|
scannerEnableWatcher: false,
|
||||||
|
jumpForwardsTime: 10,
|
||||||
|
jumpForwardsIcons: ['forward_10', 'forward_30', 'forward_5'],
|
||||||
|
currentJumpForwardsIndex: 0,
|
||||||
|
jumpBackwardsTime: 10,
|
||||||
|
jumpBackwardsIcons: ['replay_10', 'replay_30', 'replay_5'],
|
||||||
|
currentJumpBackwardsIndex: 0,
|
||||||
isPurgingCache: false,
|
isPurgingCache: false,
|
||||||
hasPrefixesChanged: false,
|
hasPrefixesChanged: false,
|
||||||
newServerSettings: {},
|
newServerSettings: {},
|
||||||
|
|
@ -262,6 +291,12 @@ export default {
|
||||||
timeExample() {
|
timeExample() {
|
||||||
const date = new Date(2014, 2, 25, 17, 30, 0)
|
const date = new Date(2014, 2, 25, 17, 30, 0)
|
||||||
return this.$formatJsTime(date, this.newServerSettings.timeFormat)
|
return this.$formatJsTime(date, this.newServerSettings.timeFormat)
|
||||||
|
},
|
||||||
|
currentJumpForwardsIcon() {
|
||||||
|
return this.jumpForwardsIcons[this.currentJumpForwardsIndex]
|
||||||
|
},
|
||||||
|
currentJumpBackwardsIcon() {
|
||||||
|
return this.jumpBackwardsIcons[this.currentJumpBackwardsIndex]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -271,6 +306,12 @@ export default {
|
||||||
const serverPrefixes = this.serverSettings.sortingPrefixes || []
|
const serverPrefixes = this.serverSettings.sortingPrefixes || []
|
||||||
this.hasPrefixesChanged = prefixes.some((p) => !serverPrefixes.includes(p)) || serverPrefixes.some((p) => !prefixes.includes(p))
|
this.hasPrefixesChanged = prefixes.some((p) => !serverPrefixes.includes(p)) || serverPrefixes.some((p) => !prefixes.includes(p))
|
||||||
},
|
},
|
||||||
|
toggleJumpForwards() {
|
||||||
|
this.currentJumpForwardsIndex = (this.currentJumpForwardsIndex + 1) % this.jumpForwardsIcons.length
|
||||||
|
},
|
||||||
|
toggleJumpBackwards() {
|
||||||
|
this.currentJumpBackwardsIndex = (this.currentJumpBackwardsIndex + 1) % this.jumpBackwardsIcons.length
|
||||||
|
},
|
||||||
updateSortingPrefixes() {
|
updateSortingPrefixes() {
|
||||||
const prefixes = [...new Set(this.newServerSettings.sortingPrefixes.map((prefix) => prefix.trim().toLowerCase()) || [])]
|
const prefixes = [...new Set(this.newServerSettings.sortingPrefixes.map((prefix) => prefix.trim().toLowerCase()) || [])]
|
||||||
if (!prefixes.length) {
|
if (!prefixes.length) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue