Merge pull request #5384 from Larvitar/season-metadata-fix

This commit is contained in:
Bond-009 2021-06-12 00:58:58 +02:00 committed by GitHub
commit 83e492b72b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,9 +213,23 @@ namespace MediaBrowser.Providers.Manager
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)