Skip to content

Commit

Permalink
stash
Browse files Browse the repository at this point in the history
  • Loading branch information
hanydd committed Dec 5, 2024
1 parent e257f5c commit b8ed8cf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,12 @@ async function startSponsorSchedule(

const currentSkip = skipInfo.array[skipInfo.index];
const skipTime: number[] = [currentSkip?.scheduledTime, skipInfo.array[skipInfo.endIndex]?.segment[1]];
const timeUntilSponsor = skipTime?.[0] - currentTime;
let timeUntilSponsor = skipTime?.[0] - currentTime;
// 提前触发跳过通知
if (Config.config.advanceSkipNotice && Config.config.skipNoticeDurationBefore > 0) {
timeUntilSponsor -= Config.config.skipNoticeDurationBefore * 1000;
}

const videoID = getVideoID();

if (
Expand Down Expand Up @@ -764,11 +769,6 @@ async function startSponsorSchedule(
} else {
logDebug(`Starting timeout to skip ${getVideo().currentTime} to skip at ${skipTime[0]}`);

// 提前触发跳过通知
if (Config.config.advanceSkipNotice && Config.config.skipNoticeDurationBefore > 0) {
delayTime -= Config.config.skipNoticeDurationBefore * 1000;
}

const offset = isFirefox() ? 600 : 150;
// Schedule for right before to be more precise than normal timeout
currentSkipSchedule = setTimeout(skippingFunction, Math.max(0, delayTime - offset));
Expand Down

0 comments on commit b8ed8cf

Please sign in to comment.