Skip to content

Commit

Permalink
fix error when season provider id is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
kookxiang committed Jul 1, 2024
1 parent d1ad29d commit 1f70dbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Jellyfin.Plugin.Bangumi/Providers/SeasonProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task<MetadataResult<Season>> GetMetadata(SeasonInfo info, Cancellat
var previousSeason = series.Children
// Search "Season 2" for "Season 1" and "Season 2 Part X"
.Where(x => x.IndexNumber == info.IndexNumber - 1 || x.IndexNumber == info.IndexNumber)
.MaxBy(x => int.Parse(x.GetProviderId(Constants.ProviderName) ?? string.Empty));
.MaxBy(x => int.Parse(x.GetProviderId(Constants.ProviderName) ?? "0"));
if (int.TryParse(previousSeason?.GetProviderId(Constants.ProviderName), out var previousSeasonId) && previousSeasonId > 0)
{
_log.LogInformation("Guessing season id from previous season #{ID}", previousSeasonId);
Expand Down

0 comments on commit 1f70dbe

Please sign in to comment.