aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2021-11-02 00:06:40 -0400
committerAjay Ramachandran <[email protected]>2021-11-02 00:06:40 -0400
commit5adcec2ca5a88e48ba77192d71464a5f5a2b8eb6 (patch)
treeb0444d4eae28e3745f6e15a9d6e7269fa7be6e56
parent36989907a210ff9fe6444fa781e2b86337a60a08 (diff)
downloadSponsorBlock-5adcec2ca5a88e48ba77192d71464a5f5a2b8eb6.tar.gz
SponsorBlock-5adcec2ca5a88e48ba77192d71464a5f5a2b8eb6.zip
Remove segment duration filter
Close #1031 #989
-rw-r--r--src/content.ts10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/content.ts b/src/content.ts
index 83a170b8..9c7b079f 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -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();