|
|
@ -132,28 +132,17 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
var type = item.GetType();
|
|
|
|
var type = item.GetType();
|
|
|
|
|
|
|
|
|
|
|
|
var service = _metadataServices.FirstOrDefault(current => current.CanRefreshPrimary(type));
|
|
|
|
var service = _metadataServices.FirstOrDefault(current => current.CanRefreshPrimary(type));
|
|
|
|
|
|
|
|
service ??= _metadataServices.FirstOrDefault(current => current.CanRefresh(item));
|
|
|
|
|
|
|
|
|
|
|
|
if (service == null)
|
|
|
|
if (service == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
foreach (var current in _metadataServices)
|
|
|
|
_logger.LogError("Unable to find a metadata service for item of type {TypeName}", item.GetType().Name);
|
|
|
|
{
|
|
|
|
return Task.FromResult(ItemUpdateType.None);
|
|
|
|
if (current.CanRefresh(item))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
service = current;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (service != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return service.RefreshMetadata(item, options, cancellationToken);
|
|
|
|
return service.RefreshMetadata(item, options, cancellationToken);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_logger.LogError("Unable to find a metadata service for item of type {TypeName}", item.GetType().Name);
|
|
|
|
|
|
|
|
return Task.FromResult(ItemUpdateType.None);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public async Task SaveImage(BaseItem item, string url, ImageType type, int? imageIndex, CancellationToken cancellationToken)
|
|
|
|
public async Task SaveImage(BaseItem item, string url, ImageType type, int? imageIndex, CancellationToken cancellationToken)
|
|
|
|
{
|
|
|
|
{
|
|
|
|