Translate the annotation from Chinese to English

This commit is contained in:
Lunatic 2026-02-28 09:46:12 +08:00
parent a046c1a5f2
commit 978128bf99

View file

@ -312,7 +312,7 @@ export default {
this.checkChapterEnd() this.checkChapterEnd()
} }
// intro/outro // check for intro/outro and skip if needed
this.checkAndSkipIntroOutro(time) this.checkAndSkipIntroOutro(time)
}, },
setDuration(duration) { setDuration(duration) {
@ -551,7 +551,7 @@ export default {
} }
}, },
// // get skip settings
getSkipSettings() { getSkipSettings() {
return { return {
skipIntro: this.$store.getters['user/getUserSetting']('skipIntro'), skipIntro: this.$store.getters['user/getUserSetting']('skipIntro'),
@ -561,7 +561,7 @@ export default {
} }
}, },
// intro/outro // check and skip intro/outro
checkAndSkipIntroOutro(currentTime) { checkAndSkipIntroOutro(currentTime) {
const skipSettings = this.getSkipSettings() const skipSettings = this.getSkipSettings()
if (!skipSettings) return if (!skipSettings) return
@ -571,10 +571,10 @@ export default {
if (!doSkipIntro && !doSkipOutro) return if (!doSkipIntro && !doSkipOutro) return
if (!this.isPlaying || !this.chapters.length) return if (!this.isPlaying || !this.chapters.length) return
// seek2 // The skip function is not triggered within 2 seconds after the user manually seeks
if (this._manualSeekTime && Date.now() - this._manualSeekTime < 2000) return if (this._manualSeekTime && Date.now() - this._manualSeekTime < 2000) return
// // Reentry guard: When skipping, wait until reaching the target position before cancelling
if (this._isSkipping) { if (this._isSkipping) {
if (this._skipTarget != null && currentTime >= this._skipTarget - 0.5) { if (this._skipTarget != null && currentTime >= this._skipTarget - 0.5) {
this._isSkipping = false this._isSkipping = false
@ -592,10 +592,10 @@ export default {
const introEndTime = Math.min(chapter.start + introDuration, chapter.end) const introEndTime = Math.min(chapter.start + introDuration, chapter.end)
const outroStartTime = Math.max(chapter.end - outroDuration, chapter.start) const outroStartTime = Math.max(chapter.end - outroDuration, chapter.start)
// introoutro // Short chapter: If the intro and outro intervals overlap, do not skip
if (doSkipIntro && doSkipOutro && introEndTime > outroStartTime) return if (doSkipIntro && doSkipOutro && introEndTime > outroStartTime) return
// intro // Check whether it is within the intro interval
if (doSkipIntro && currentTime < introEndTime) { if (doSkipIntro && currentTime < introEndTime) {
const target = introEndTime + 0.5 const target = introEndTime + 0.5
this._isSkipping = true this._isSkipping = true
@ -604,18 +604,18 @@ export default {
return return
} }
// outro // check whether it is within the outro interval
if (doSkipOutro && currentTime >= outroStartTime) { if (doSkipOutro && currentTime >= outroStartTime) {
const chapterIndex = this.chapters.indexOf(chapter) const chapterIndex = this.chapters.indexOf(chapter)
const nextChapter = this.chapters[chapterIndex + 1] const nextChapter = this.chapters[chapterIndex + 1]
if (nextChapter) { if (nextChapter) {
// skipIntrointro // has next chapter: skip to next chapter start (if skipIntro is on, skip intro)
let target = nextChapter.start let target = nextChapter.start
if (doSkipIntro) { if (doSkipIntro) {
const nextIntroEnd = Math.min(nextChapter.start + introDuration, nextChapter.end) const nextIntroEnd = Math.min(nextChapter.start + introDuration, nextChapter.end)
const nextOutroStart = Math.max(nextChapter.end - outroDuration, nextChapter.start) const nextOutroStart = Math.max(nextChapter.end - outroDuration, nextChapter.start)
// intro/outro // ensure that the next chapter intro/outro does not overlap
if (nextIntroEnd <= nextOutroStart) { if (nextIntroEnd <= nextOutroStart) {
target = nextIntroEnd + 0.5 target = nextIntroEnd + 0.5
} }
@ -624,7 +624,7 @@ export default {
this._skipTarget = target this._skipTarget = target
this.seek(target) this.seek(target)
} else { } else {
// // last chapter: skip to end
this._isSkipping = true this._isSkipping = true
this._skipTarget = chapter.end this._skipTarget = chapter.end
this.seek(chapter.end) this.seek(chapter.end)