mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 05:57:07 +03:00
Hide segments with different video durations
This commit is contained in:
@@ -668,7 +668,8 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) {
|
|||||||
if (response?.ok) {
|
if (response?.ok) {
|
||||||
const recievedSegments: SponsorTime[] = JSON.parse(response.responseText)
|
const recievedSegments: SponsorTime[] = JSON.parse(response.responseText)
|
||||||
?.filter((video) => video.videoID === id)
|
?.filter((video) => video.videoID === id)
|
||||||
?.map((video) => video.segments)[0];
|
?.map((video) => video.segments)[0]
|
||||||
|
?.filter((segment) => segment.videoDuration === 0 || Math.abs(video.duration - segment.videoDuration) < 2);
|
||||||
if (!recievedSegments || !recievedSegments.length) {
|
if (!recievedSegments || !recievedSegments.length) {
|
||||||
// return if no video found
|
// return if no video found
|
||||||
retryFetch();
|
retryFetch();
|
||||||
|
|||||||
Reference in New Issue
Block a user