mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Include unsubmitted in active segment label
This commit is contained in:
@@ -459,7 +459,7 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
|
|||||||
if (!video) return;
|
if (!video) return;
|
||||||
if (currentTime === undefined || currentTime === null) currentTime = video.currentTime;
|
if (currentTime === undefined || currentTime === null) currentTime = video.currentTime;
|
||||||
|
|
||||||
previewBar?.updateChapterText(sponsorTimes, currentTime);
|
previewBar?.updateChapterText(sponsorTimes, sponsorTimesSubmitting, currentTime);
|
||||||
|
|
||||||
if (video.paused) return;
|
if (video.paused) return;
|
||||||
if (videoMuted && !inMuteSegment(currentTime)) {
|
if (videoMuted && !inMuteSegment(currentTime)) {
|
||||||
@@ -666,7 +666,7 @@ function setupVideoListeners() {
|
|||||||
|
|
||||||
startSponsorSchedule();
|
startSponsorSchedule();
|
||||||
} else {
|
} else {
|
||||||
previewBar?.updateChapterText(sponsorTimes, video.currentTime);
|
previewBar?.updateChapterText(sponsorTimes, sponsorTimesSubmitting, video.currentTime);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
video.addEventListener('ratechange', () => startSponsorSchedule());
|
video.addEventListener('ratechange', () => startSponsorSchedule());
|
||||||
|
|||||||
@@ -552,9 +552,10 @@ class PreviewBar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateChapterText(segments: SponsorTime[], currentTime: number): void {
|
updateChapterText(segments: SponsorTime[], submittingSegments: SponsorTime[], currentTime: number): void {
|
||||||
if (!segments) return;
|
if (!segments) return;
|
||||||
|
|
||||||
|
if (submittingSegments?.length > 0) segments = segments.concat(submittingSegments);
|
||||||
const activeSegments = segments.filter((segment) => {
|
const activeSegments = segments.filter((segment) => {
|
||||||
return segment.segment[0] <= currentTime && segment.segment[1] > currentTime;
|
return segment.segment[0] <= currentTime && segment.segment[1] > currentTime;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user