Skip to content

Commit

Permalink
prettify index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
fire332 committed Mar 31, 2024
1 parent ebd29c6 commit 480b4e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<script src="index.js"></script>
Expand Down
43 changes: 23 additions & 20 deletions src/sponsorblock.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,27 +303,30 @@ class SponsorBlockHandler {
start - this.video.currentTime
);

this.nextSkipTimeout = setTimeout(() => {
if (this.video.paused) {
console.info(this.videoID, 'Currently paused, ignoring...');
return;
}
if (!this.skippableCategories.includes(segment.category)) {
console.info(
this.videoID,
'Segment',
segment.category,
'is not skippable, ignoring...'
);
return;
}
this.nextSkipTimeout = setTimeout(
() => {
if (this.video.paused) {
console.info(this.videoID, 'Currently paused, ignoring...');
return;
}
if (!this.skippableCategories.includes(segment.category)) {
console.info(
this.videoID,
'Segment',
segment.category,
'is not skippable, ignoring...'
);
return;
}

const skipName = barTypes[segment.category]?.name || segment.category;
console.info(this.videoID, 'Skipping', segment);
showNotification(`Skipping ${skipName}`);
this.video.currentTime = end;
this.scheduleSkip();
}, (start - this.video.currentTime) * 1000);
const skipName = barTypes[segment.category]?.name || segment.category;
console.info(this.videoID, 'Skipping', segment);
showNotification(`Skipping ${skipName}`);
this.video.currentTime = end;
this.scheduleSkip();
},
(start - this.video.currentTime) * 1000
);
}

destroy() {
Expand Down

0 comments on commit 480b4e8

Please sign in to comment.