mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-16 20:52:06 +00:00
Keep segments when skipping
This commit is contained in:
@ -12,16 +12,16 @@ module.exports = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ontimeupdate((videoElement) => {
|
ontimeupdate((videoElement) => {
|
||||||
if (
|
currentSegments.forEach((segment) => {
|
||||||
currentSegments.length > 0 &&
|
if (
|
||||||
videoElement.currentTime >= currentSegments[0][0] &&
|
videoElement.currentTime >= segment[0] &&
|
||||||
videoElement.currentTime <= currentSegments[0][1]
|
videoElement.currentTime <= segment[1]
|
||||||
) {
|
) {
|
||||||
videoElement.currentTime = currentSegments[0][1];
|
videoElement.currentTime = segment[1];
|
||||||
const skipped = currentSegments.shift();
|
if (is.dev()) {
|
||||||
if (is.dev()) {
|
console.log("SponsorBlock: skipping segment", segment);
|
||||||
console.log("SponsorBlock: skipping segment", skipped);
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user