diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html index b2604e5..a95311d 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html @@ -784,12 +784,12 @@ const rightEpisode = selectEpisode2.options[selectEpisode2.selectedIndex]; // Try to get the timestamps of each intro, falling back a default value of zero if no intro was found - let leftEpisodeIntro = await getJson("Episode/" + selectEpisode1.value + "/IntroTimestamps/v1"); + let leftEpisodeIntro = await getJson("Episode/" + leftEpisode.value + "/IntroTimestamps/v1"); if (leftEpisodeIntro === null) { leftEpisodeIntro = { IntroStart: 0, IntroEnd: 0 }; } - let rightEpisodeIntro = await getJson("Episode/" + selectEpisode2.value + "/IntroTimestamps/v1"); + let rightEpisodeIntro = await getJson("Episode/" + rightEpisode.value + "/IntroTimestamps/v1"); if (rightEpisodeIntro === null) { rightEpisodeIntro = { IntroStart: 0, IntroEnd: 0 }; } @@ -828,15 +828,14 @@ async function getJson(url) { return await fetchWithAuth(url, "GET") .then(r => { - if (r.status == 404) { - return null; - } else { + if (r.ok) { return r.json(); + } else { + return null; } }) .catch(err => { console.debug(err); - return undefined; }); } diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs index 82c2cfc..3ab7816 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/ScheduledTasks/BaseItemAnalyzerTask.cs @@ -53,9 +53,9 @@ public class BaseItemAnalyzerTask IProgress progress, CancellationToken cancellationToken) { - var ffmpegError = FFmpegWrapper.CheckFFmpegVersion(); + var ffmpegValid = FFmpegWrapper.CheckFFmpegVersion(); // Assert that ffmpeg with chromaprint is installed - if (Plugin.Instance!.Configuration.UseChromaprint && !ffmpegError) + if (Plugin.Instance!.Configuration.UseChromaprint && !ffmpegValid) { throw new FingerprintException( "Analysis terminated! Chromaprint is not enabled in the current ffmpeg. If Jellyfin is running natively, install jellyfin-ffmpeg5. If Jellyfin is running in a container, upgrade to version 10.8.0 or newer.");