Removed code as suggested by @cvium

This commit is contained in:
Fernando Fernández 2020-11-09 21:46:18 +01:00
parent 9fd01fade6
commit 103d503c15

View File

@ -252,7 +252,13 @@ namespace MediaBrowser.Providers.Manager
if (!string.IsNullOrWhiteSpace(person.ImageUrl) && !personEntity.HasImage(ImageType.Primary))
{
await AddPersonImageAsync(personEntity, libraryOptions, person.ImageUrl, cancellationToken).ConfigureAwait(false);
personEntity.SetImage(
new ItemImageInfo
{
Path = person.ImageUrl,
Type = ImageType.Primary
},
0);
saveEntity = true;
updateType |= ItemUpdateType.ImageUpdate;
@ -266,27 +272,6 @@ namespace MediaBrowser.Providers.Manager
}
}
private async Task AddPersonImageAsync(Person personEntity, LibraryOptions libraryOptions, string imageUrl, CancellationToken cancellationToken)
{
try
{
await ProviderManager.SaveImage(personEntity, imageUrl, ImageType.Primary, null, cancellationToken).ConfigureAwait(false);
return;
}
catch (Exception ex)
{
Logger.LogError(ex, "Error in AddPersonImage");
}
personEntity.SetImage(
new ItemImageInfo
{
Path = imageUrl,
Type = ImageType.Primary
},
0);
}
protected virtual Task AfterMetadataRefresh(TItemType item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
{
item.AfterMetadataRefresh();