mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
@@ -396,13 +396,6 @@ function createPreviewBar(): void {
|
||||
function durationChangeListener(): void {
|
||||
updateAdFlag();
|
||||
updatePreviewBar();
|
||||
|
||||
if (sponsorTimes) sponsorTimes = sponsorTimes.filter(segmentDurationFilter);
|
||||
}
|
||||
|
||||
function segmentDurationFilter(segment: SponsorTime): boolean {
|
||||
return segment.videoDuration === 0 || !video?.duration
|
||||
|| switchingVideos || Math.abs(video.duration - segment.videoDuration) < 2;
|
||||
}
|
||||
|
||||
function cancelSponsorSchedule(): void {
|
||||
@@ -687,8 +680,7 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) {
|
||||
if (response?.ok) {
|
||||
const recievedSegments: SponsorTime[] = JSON.parse(response.responseText)
|
||||
?.filter((video) => video.videoID === id)
|
||||
?.map((video) => video.segments)[0]
|
||||
?.filter(segmentDurationFilter);
|
||||
?.map((video) => video.segments)[0];
|
||||
if (!recievedSegments || !recievedSegments.length) {
|
||||
// return if no video found
|
||||
retryFetch();
|
||||
|
||||
Reference in New Issue
Block a user