|
|
|
@ -100,21 +100,29 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Start by validating images
|
|
|
|
|
var localImagesFailed = false;
|
|
|
|
|
var allImageProviders = ProviderManager.GetImageProviders(item, refreshOptions).ToList();
|
|
|
|
|
try
|
|
|
|
|
|
|
|
|
|
// Only validate already registered images if we are replacing and saving locally
|
|
|
|
|
if (item.IsSaveLocalMetadataEnabled() && refreshOptions.ReplaceAllImages)
|
|
|
|
|
{
|
|
|
|
|
// Always validate images and check for new locally stored ones.
|
|
|
|
|
if (ImageProvider.ValidateImages(item, allImageProviders.OfType<ILocalImageProvider>(), refreshOptions))
|
|
|
|
|
{
|
|
|
|
|
updateType |= ItemUpdateType.ImageUpdate;
|
|
|
|
|
}
|
|
|
|
|
item.ValidateImages();
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
localImagesFailed = true;
|
|
|
|
|
Logger.LogError(ex, "Error validating images for {Item}", item.Path ?? item.Name ?? "Unknown name");
|
|
|
|
|
// Run full image validation and register new local images
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (ImageProvider.ValidateImages(item, allImageProviders.OfType<ILocalImageProvider>(), refreshOptions))
|
|
|
|
|
{
|
|
|
|
|
updateType |= ItemUpdateType.ImageUpdate;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
localImagesFailed = true;
|
|
|
|
|
Logger.LogError(ex, "Error validating images for {Item}", item.Path ?? item.Name ?? "Unknown name");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var metadataResult = new MetadataResult<TItemType>
|
|
|
|
|