Almost everything returns null

This commit is contained in:
TwistedUmbrellaX 2024-03-19 20:58:48 -04:00
parent b8053a3911
commit 1f4debc33f
2 changed files with 7 additions and 8 deletions

View File

@ -784,12 +784,12 @@
const rightEpisode = selectEpisode2.options[selectEpisode2.selectedIndex]; 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 // 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) { if (leftEpisodeIntro === null) {
leftEpisodeIntro = { IntroStart: 0, IntroEnd: 0 }; 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) { if (rightEpisodeIntro === null) {
rightEpisodeIntro = { IntroStart: 0, IntroEnd: 0 }; rightEpisodeIntro = { IntroStart: 0, IntroEnd: 0 };
} }
@ -828,15 +828,14 @@
async function getJson(url) { async function getJson(url) {
return await fetchWithAuth(url, "GET") return await fetchWithAuth(url, "GET")
.then(r => { .then(r => {
if (r.status == 404) { if (r.ok) {
return null;
} else {
return r.json(); return r.json();
} else {
return null;
} }
}) })
.catch(err => { .catch(err => {
console.debug(err); console.debug(err);
return undefined;
}); });
} }

View File

@ -53,9 +53,9 @@ public class BaseItemAnalyzerTask
IProgress<double> progress, IProgress<double> progress,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
var ffmpegError = FFmpegWrapper.CheckFFmpegVersion(); var ffmpegValid = FFmpegWrapper.CheckFFmpegVersion();
// Assert that ffmpeg with chromaprint is installed // Assert that ffmpeg with chromaprint is installed
if (Plugin.Instance!.Configuration.UseChromaprint && !ffmpegError) if (Plugin.Instance!.Configuration.UseChromaprint && !ffmpegValid)
{ {
throw new FingerprintException( 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."); "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.");