Chapter and Total Track in Player

This patch allows user to not only add a chapter track but also remove
the total track. This means that you can have only the total track or
only the chapter track.

This patch does not allow user to have no track at all. Disabling one
track will automatically enable the other one, if that one is already
disabled.

The reasoning behind this is that for long-ish audio books, users will
not very often look at the overall progress. In fact, I find the
progress bar mostly useful only for quickly seeking to a position when
jumping back a few seconds is not sufficient.

In the seldom occasion that I want the overall progress, I can easily
get it from the book details page.
This commit is contained in:
Lars Kiesow 2023-01-17 00:54:17 +01:00
parent 56fe350104
commit d89c97ba1a
No known key found for this signature in database
GPG key ID: 5DAFE8D9C823CE73
2 changed files with 34 additions and 1 deletions

View file

@ -60,6 +60,24 @@ class LocalStorage {
}
}
async setUseTotalTrack(useTotalTrack) {
try {
await Storage.set({ key: 'useTotalTrack', value: useTotalTrack ? '1' : '0' })
} catch (error) {
console.error('[LocalStorage] Failed to set use total track', error)
}
}
async getUseTotalTrack() {
try {
var obj = await Storage.get({ key: 'useTotalTrack' }) || {}
return obj.value === '1'
} catch (error) {
console.error('[LocalStorage] Failed to get use total track', error)
return false
}
}
async setPlayerLock(lock) {
try {
await Storage.set({ key: 'playerLock', value: lock ? '1' : '0' })