mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-07-16 00:44:51 +02:00
Move AbsAudioPlayer.setChapterTrack to AudioPlayer instead of localStore
This commit is contained in:
parent
73d70dd480
commit
322cad5548
2 changed files with 9 additions and 8 deletions
|
@ -695,8 +695,8 @@ export default {
|
|||
this.updateTimestamp()
|
||||
this.updateTrack()
|
||||
this.updateReadyTrack()
|
||||
this.updateUseChapterTrack()
|
||||
this.$localStore.setUseTotalTrack(this.useTotalTrack)
|
||||
this.$localStore.setUseChapterTrack(this.useChapterTrack)
|
||||
} else if (action === 'total_track') {
|
||||
this.useTotalTrack = !this.useTotalTrack
|
||||
this.useChapterTrack = !this.useTotalTrack || this.useChapterTrack
|
||||
|
@ -704,13 +704,20 @@ export default {
|
|||
this.updateTimestamp()
|
||||
this.updateTrack()
|
||||
this.updateReadyTrack()
|
||||
this.updateUseChapterTrack()
|
||||
this.$localStore.setUseTotalTrack(this.useTotalTrack)
|
||||
this.$localStore.setUseChapterTrack(this.useChapterTrack)
|
||||
} else if (action === 'close') {
|
||||
this.closePlayback()
|
||||
}
|
||||
})
|
||||
},
|
||||
updateUseChapterTrack() {
|
||||
this.$localStore.setUseChapterTrack(this.useChapterTrack)
|
||||
// Chapter track in NowPlaying only supported on iOS for now
|
||||
if (this.$platform === 'ios') {
|
||||
AbsAudioPlayer.setChapterTrack({ enabled: this.useChapterTrack })
|
||||
}
|
||||
},
|
||||
forceCloseDropdownMenu() {
|
||||
if (this.$refs.dropdownMenu && this.$refs.dropdownMenu.closeMenu) {
|
||||
this.$refs.dropdownMenu.closeMenu()
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
import { Preferences } from '@capacitor/preferences'
|
||||
import { AbsAudioPlayer } from '@/plugins/capacitor'
|
||||
import { Capacitor } from '@capacitor/core'
|
||||
|
||||
|
||||
class LocalStorage {
|
||||
constructor(vuexStore) {
|
||||
|
@ -48,9 +45,6 @@ class LocalStorage {
|
|||
async setUseChapterTrack(useChapterTrack) {
|
||||
try {
|
||||
await Preferences.set({ key: 'useChapterTrack', value: useChapterTrack ? '1' : '0' })
|
||||
if (Capacitor.getPlatform() === 'ios') {
|
||||
AbsAudioPlayer.setChapterTrack({ enabled: useChapterTrack })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('[LocalStorage] Failed to set use chapter track', error)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue