diff options
author | Ajay <[email protected]> | 2023-08-09 18:24:21 -0400 |
---|---|---|
committer | Ajay <[email protected]> | 2023-08-09 18:24:21 -0400 |
commit | fc8e20be0d1b13711f421217f8bb3f7d8f0aa7bc (patch) | |
tree | ad974a3a9458ebae215d54960a7daee2336ab511 | |
parent | 368059eb0de9d6cb14e0af57263a90ac3d094cb3 (diff) | |
download | SponsorBlock-fc8e20be0d1b13711f421217f8bb3f7d8f0aa7bc.tar.gz SponsorBlock-fc8e20be0d1b13711f421217f8bb3f7d8f0aa7bc.zip |
Impove incorrect video check, and add better logging to it
Potential fix for #1820
-rw-r--r-- | src/content.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/content.ts b/src/content.ts index dbc834a3..f71e5ddd 100644 --- a/src/content.ts +++ b/src/content.ts @@ -803,11 +803,12 @@ function incorrectVideoCheck(videoID?: string, sponsorTime?: SponsorTime): boole const currentVideoID = getYouTubeVideoID(); const recordedVideoID = videoID || getVideoID(); if (currentVideoID !== recordedVideoID || (sponsorTime - && (!sponsorTimes || !sponsorTimes?.some((time) => time.segment === sponsorTime.segment)) - && !sponsorTimesSubmitting.some((time) => time.segment === sponsorTime.segment))) { + && (!sponsorTimes || !sponsorTimes?.some((time) => time.segment[0] === sponsorTime.segment[0] && time.segment[1] === sponsorTime.segment[1])) + && !sponsorTimesSubmitting.some((time) => time.segment[0] === sponsorTime.segment[0] && time.segment[1] === sponsorTime.segment[1]))) { // Something has really gone wrong console.error("[SponsorBlock] The videoID recorded when trying to skip is different than what it should be."); console.error("[SponsorBlock] VideoID recorded: " + recordedVideoID + ". Actual VideoID: " + currentVideoID); + console.error("[SponsorBlock] SponsorTime", sponsorTime, "sponsorTimes", sponsorTimes, "sponsorTimesSubmitting", sponsorTimesSubmitting); // Video ID change occured checkVideoIDChange(); |