Skip to content

Commit

Permalink
fix error when season folder not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
fiochen authored and kookxiang committed Jul 17, 2024
1 parent 59b0fa7 commit be88de2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Jellyfin.Plugin.Bangumi/Providers/SeasonProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task<MetadataResult<Season>> GetMetadata(SeasonInfo info, Cancellat
};
var localConfiguration = await LocalConfiguration.ForPath(info.Path);

var parent = _libraryManager.FindByPath(Path.GetDirectoryName(info.Path), true);
var seasonPath = Path.GetDirectoryName(info.Path);

var subjectId = 0;
if (localConfiguration.Id != 0)
Expand All @@ -65,7 +65,7 @@ public async Task<MetadataResult<Season>> GetMetadata(SeasonInfo info, Cancellat
{
subjectId = subjectIdFromParent;
}
else if (parent is Series series)
else if (seasonPath is not null && _libraryManager.FindByPath(seasonPath, true) is Series series)
{
var previousSeason = series.Children
// Search "Season 2" for "Season 1" and "Season 2 Part X"
Expand Down

0 comments on commit be88de2

Please sign in to comment.