|
|
|
@ -269,6 +269,13 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
|
Providers = providers.Select(i => i.GetType().FullName.GetMD5()).ToList()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var customProviders = providers.OfType<ICustomMetadataProvider<TItemType>>().ToList();
|
|
|
|
|
|
|
|
|
|
foreach (var provider in customProviders.Where(i => i is IPreRefreshProvider))
|
|
|
|
|
{
|
|
|
|
|
await RunCustomProvider(provider, item, options.DirectoryService, refreshResult, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var temp = CreateNew();
|
|
|
|
|
temp.Path = item.Path;
|
|
|
|
|
|
|
|
|
@ -342,7 +349,7 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
|
MergeData(temp, item, item.LockedFields, true, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var provider in providers.OfType<ICustomMetadataProvider<TItemType>>())
|
|
|
|
|
foreach (var provider in customProviders.Where(i => !(i is IPreRefreshProvider)))
|
|
|
|
|
{
|
|
|
|
|
await RunCustomProvider(provider, item, options.DirectoryService, refreshResult, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
@ -379,6 +386,9 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
|
{
|
|
|
|
|
TIdType id = null;
|
|
|
|
|
|
|
|
|
|
var unidentifiedCount = 0;
|
|
|
|
|
var identifiedCount = 0;
|
|
|
|
|
|
|
|
|
|
foreach (var provider in providers)
|
|
|
|
|
{
|
|
|
|
|
var providerName = provider.GetType().Name;
|
|
|
|
@ -402,9 +412,12 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
|
MergeData(result.Item, temp, new List<MetadataFields>(), false, false);
|
|
|
|
|
|
|
|
|
|
refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataDownload;
|
|
|
|
|
|
|
|
|
|
identifiedCount++;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
unidentifiedCount++;
|
|
|
|
|
Logger.Debug("{0} returned no metadata for {1}", providerName, item.Path ?? item.Name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -414,11 +427,20 @@ namespace MediaBrowser.Providers.Manager
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
unidentifiedCount++;
|
|
|
|
|
refreshResult.Status = ProviderRefreshStatus.CompletedWithErrors;
|
|
|
|
|
refreshResult.ErrorMessage = ex.Message;
|
|
|
|
|
Logger.ErrorException("Error in {0}", ex, provider.Name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var isUnidentified = unidentifiedCount > 0 && identifiedCount == 0;
|
|
|
|
|
|
|
|
|
|
if (item.IsUnidentified != isUnidentified)
|
|
|
|
|
{
|
|
|
|
|
item.IsUnidentified = isUnidentified;
|
|
|
|
|
refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataImport;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void MergeNewData(TItemType source, TIdType lookupInfo)
|
|
|
|
|