mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-03 22:49:42 +00:00
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:
parent
d157388680
commit
8a34eff1e9
3 changed files with 26 additions and 54 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue