Hide segments with different video durations

This commit is contained in:
Ajay Ramachandran
2021-09-28 19:58:51 -04:00
parent 76d9a9afa9
commit de607d317f

View File

@@ -668,7 +668,8 @@ 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];
?.map((video) => video.segments)[0]
?.filter((segment) => segment.videoDuration === 0 || Math.abs(video.duration - segment.videoDuration) < 2);
if (!recievedSegments || !recievedSegments.length) {
// return if no video found
retryFetch();