|
@@ -283,12 +283,7 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(person.ImageUrl) && !personEntity.HasImage(ImageType.Primary))
|
|
if (!string.IsNullOrWhiteSpace(person.ImageUrl) && !personEntity.HasImage(ImageType.Primary))
|
|
{
|
|
{
|
|
- personEntity.SetImage(new ItemImageInfo
|
|
|
|
- {
|
|
|
|
- Path = person.ImageUrl,
|
|
|
|
- Type = ImageType.Primary,
|
|
|
|
- IsPlaceholder = true
|
|
|
|
- }, 0);
|
|
|
|
|
|
+ await AddPersonImage(personEntity, person.ImageUrl, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
|
saveEntity = true;
|
|
saveEntity = true;
|
|
updateType = updateType | ItemUpdateType.ImageUpdate;
|
|
updateType = updateType | ItemUpdateType.ImageUpdate;
|
|
@@ -302,6 +297,23 @@ namespace MediaBrowser.Providers.Manager
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private async Task AddPersonImage(Person personEntity, string imageUrl, CancellationToken cancellationToken)
|
|
|
|
+ {
|
|
|
|
+ if (ServerConfigurationManager.Configuration.DownloadImagesInAdvance)
|
|
|
|
+ {
|
|
|
|
+ await ProviderManager.SaveImage(personEntity, imageUrl, null, ImageType.Primary, null, cancellationToken).ConfigureAwait(false);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ personEntity.SetImage(new ItemImageInfo
|
|
|
|
+ {
|
|
|
|
+ Path = imageUrl,
|
|
|
|
+ Type = ImageType.Primary,
|
|
|
|
+ IsPlaceholder = true
|
|
|
|
+ }, 0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private readonly Task _cachedTask = Task.FromResult(true);
|
|
private readonly Task _cachedTask = Task.FromResult(true);
|
|
protected virtual Task AfterMetadataRefresh(TItemType item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
|
|
protected virtual Task AfterMetadataRefresh(TItemType item, MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
|
|
{
|
|
{
|