From 720e48ce38610d608efdeaa50d56b9d81ee69f06 Mon Sep 17 00:00:00 2001 From: Mikal Stordal Date: Mon, 7 Oct 2024 04:26:59 +0200 Subject: [PATCH] fix: fix episode parent series field usage (take 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Moved the check from code path A to code path B, because the check was a no-operation on code path A and should had been placed on code path B in the first place. 🤦 --- Shokofin/API/ShokoAPIClient.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Shokofin/API/ShokoAPIClient.cs b/Shokofin/API/ShokoAPIClient.cs index c4e58a53..0d556b06 100644 --- a/Shokofin/API/ShokoAPIClient.cs +++ b/Shokofin/API/ShokoAPIClient.cs @@ -353,13 +353,7 @@ public Task GetEpisode(string id) // If the episode has no 'movie' images, get the series images to compensate. if (episodeImages.Posters.Count is 0) { var episode1 = await GetEpisode(id); - var seriesId = episode1.IDs.ParentSeries.ToString(); - if (UseEpisodeGetSeriesEndpoint) { - var series = await GetSeriesFromEpisode(id); - if (series != null) - seriesId = series.IDs.Shoko.ToString(); - } - var seriesImages1 = seriesId is not "0" ? await GetSeriesImages(seriesId) ?? new() : new(); + var seriesImages1 = await GetSeriesImages(episode1.IDs.ParentSeries.ToString()) ?? new(); episodeImages.Posters = seriesImages1.Posters; episodeImages.Logos = seriesImages1.Logos; @@ -370,7 +364,13 @@ public Task GetEpisode(string id) } var episode0 = await GetEpisode(id); - var seriesImages0 = await GetSeriesImages(episode0.IDs.ParentSeries.ToString()) ?? new(); + var seriesId0 = episode0.IDs.ParentSeries.ToString(); + if (UseEpisodeGetSeriesEndpoint) { + var series = await GetSeriesFromEpisode(id); + if (series != null) + seriesId0 = series.IDs.Shoko.ToString(); + } + var seriesImages0 = seriesId0 is not "0" ? await GetSeriesImages(seriesId0) ?? new() : new(); return new() { Banners = seriesImages0.Banners, Backdrops = seriesImages0.Backdrops,