Skip to content

Commit

Permalink
add return if no season id found
Browse files Browse the repository at this point in the history
  • Loading branch information
scampower3 committed May 31, 2024
1 parent 445cc2b commit 493cf8e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Jellyfin.Plugin.Tvdb/Providers/TvdbSeasonProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ public async Task<MetadataResult<Season>> GetMetadata(SeasonInfo info, Cancellat
var seriesInfo = await _tvdbClientManager.GetSeriesExtendedByIdAsync(series.GetTvdbId(), string.Empty, cancellationToken, small: true)
.ConfigureAwait(false);
seasonId = seriesInfo.Seasons.FirstOrDefault(s => s.Number == info.IndexNumber && string.Equals(s.Type.Type, displayOrder, StringComparison.OrdinalIgnoreCase))?.Id;

if (seasonId == null)
{
_logger.LogDebug("No season identity found for {SeasonName}", info.Name);
return new MetadataResult<Season>
{
QueriedById = true
};
}
}

var seasonInfo = await _tvdbClientManager.GetSeasonByIdAsync(seasonId ?? 0, string.Empty, cancellationToken)
Expand Down

0 comments on commit 493cf8e

Please sign in to comment.