Merge branch 'master' of https://github.com/ajayyy/SponsorBlockServer into switch-axios

This commit is contained in:
Michael C
2021-09-26 18:04:22 -04:00
6 changed files with 152 additions and 136 deletions

View File

@@ -449,8 +449,8 @@ async function updateDataIfVideoDurationChange(videoID: VideoID, service: string
let apiVideoInfo: APIVideoInfo = null;
if (service == Service.YouTube) {
// Don't use cache if we don't know the video duraton, or the client claims that it has changed
apiVideoInfo = await getYouTubeVideoInfo(videoID, !videoDurationParam || videoDurationChanged(videoDurationParam));
// Don't use cache if we don't know the video duration, or the client claims that it has changed
apiVideoInfo = await getYouTubeVideoInfo(videoID, !videoDurationParam || previousSubmissions.length === 0 || videoDurationChanged(videoDurationParam));
}
const apiVideoDuration = apiVideoInfo?.data?.lengthSeconds as VideoDuration;
if (!videoDurationParam || (apiVideoDuration && Math.abs(videoDurationParam - apiVideoDuration) > 2)) {