Skip to content

Commit

Permalink
fix: don't assume the tmdb episode exists
Browse files Browse the repository at this point in the history
Don't assume the TMDB episode exists, even if we have a cross-reference for it.
  • Loading branch information
revam committed Dec 7, 2024
1 parent 4af8321 commit 2949d67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Shokofin/API/ShokoAPIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ private Task<SeasonInfo> CreateSeasonInfo(TmdbSeason tmdbSeason, TmdbShow tmdbSh
string? topLevelShokoGroupId = null;
if (tmdbSeason.SeasonNumber > 0) {
var animeIds = (await ApiClient.GetTmdbCrossReferencesForTmdbShow(tmdbSeason.ShowId.ToString()).ConfigureAwait(false))
.Where(x => tmdbEpisodes[x.TmdbEpisodeId].SeasonId == tmdbSeason.Id)
.Where(x => tmdbEpisodes.TryGetValue(x.TmdbEpisodeId, out var tmdbEpisode) && tmdbEpisode.SeasonId == tmdbSeason.Id)
.GroupBy(x => x.AnidbAnimeId)
.OrderByDescending(x => x.Count())
.Select(x => x.Key)
Expand Down

0 comments on commit 2949d67

Please sign in to comment.