Refactor skip intro/outro to global settings instead of per-book

Settings are now stored as top-level user settings in localStorage
rather than nested under bookSkipSettings per libraryItemId. This
makes the settings always accessible regardless of playback state.
This commit is contained in:
Lunatic 2026-02-27 15:19:46 +08:00
parent d157388680
commit 8a34eff1e9
3 changed files with 26 additions and 54 deletions

View file

@ -548,16 +548,19 @@ export default {
}
},
//
getBookSkipSettings() {
if (!this.streamLibraryItem) return null
const bookSkipSettings = this.$store.getters['user/getUserSetting']('bookSkipSettings') || {}
return bookSkipSettings[this.streamLibraryItem.id] || {}
//
getSkipSettings() {
return {
skipIntro: this.$store.getters['user/getUserSetting']('skipIntro'),
introDuration: this.$store.getters['user/getUserSetting']('introDuration'),
skipOutro: this.$store.getters['user/getUserSetting']('skipOutro'),
outroDuration: this.$store.getters['user/getUserSetting']('outroDuration')
}
},
// intro/outro
checkAndSkipIntroOutro(currentTime) {
const skipSettings = this.getBookSkipSettings()
const skipSettings = this.getSkipSettings()
if (!skipSettings) return
const doSkipIntro = skipSettings.skipIntro && skipSettings.introDuration > 0