Skip to content

Commit

Permalink
Merge pull request jellyfin#5384 from Larvitar/season-metadata-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bond-009 authored Jun 11, 2021
2 parents cb77f8e + 8daa679 commit 83e492b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions MediaBrowser.Providers/Manager/MetadataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,23 @@ public async Task<ItemUpdateType> RefreshMetadata(BaseItem item, MetadataRefresh

private void ApplySearchResult(ItemLookupInfo lookupInfo, RemoteSearchResult result)
{
lookupInfo.ProviderIds = result.ProviderIds;
lookupInfo.Name = result.Name;
lookupInfo.Year = result.ProductionYear;
// Episode and Season do not support Identify, so the search results are the Series'
switch (lookupInfo)
{
case EpisodeInfo episodeInfo:
episodeInfo.SeriesProviderIds = result.ProviderIds;
episodeInfo.ProviderIds.Clear();
break;
case SeasonInfo seasonInfo:
seasonInfo.SeriesProviderIds = result.ProviderIds;
seasonInfo.ProviderIds.Clear();
break;
default:
lookupInfo.ProviderIds = result.ProviderIds;
lookupInfo.Name = result.Name;
lookupInfo.Year = result.ProductionYear;
break;
}
}

protected async Task SaveItemAsync(MetadataResult<TItemType> result, ItemUpdateType reason, CancellationToken cancellationToken)
Expand Down

0 comments on commit 83e492b

Please sign in to comment.