only run identity providers if refreshing metadata

pull/702/head
Luke Pulverenti 10 years ago
parent 76ed60605b
commit 88fce3670a

@ -103,9 +103,6 @@ namespace MediaBrowser.Providers.Manager
refreshResult.AddStatus(ProviderRefreshStatus.Failure, ex.Message);
}
// Identify item
TIdType id = null;
// Next run metadata providers
if (refreshOptions.MetadataRefreshMode != MetadataRefreshMode.None)
{
@ -122,23 +119,19 @@ namespace MediaBrowser.Providers.Manager
if (providers.Count > 0)
{
id = await CreateInitialLookupInfo(itemOfType, cancellationToken).ConfigureAwait(false);
var id = await CreateInitialLookupInfo(itemOfType, cancellationToken).ConfigureAwait(false);
var result = await RefreshWithProviders(itemOfType, id, refreshOptions, providers, itemImageProvider, cancellationToken).ConfigureAwait(false);
updateType = updateType | result.UpdateType;
refreshResult.AddStatus(result.Status, result.ErrorMessage);
refreshResult.SetDateLastMetadataRefresh(DateTime.UtcNow);
refreshResult.AddImageProvidersRefreshed(result.Providers);
}
}
if (id == null)
{
id = await CreateInitialLookupInfo(itemOfType, cancellationToken).ConfigureAwait(false);
MergeIdentities(itemOfType, id);
}
}
MergeIdentities(itemOfType, id);
// Next run remote image providers, but only if local image providers didn't throw an exception
if (!localImagesFailed && refreshOptions.ImageRefreshMode != ImageRefreshMode.ValidationOnly)
{
@ -491,7 +484,7 @@ namespace MediaBrowser.Providers.Manager
{
try
{
//await hasIdentity.FindIdentities(ProviderManager, cancellationToken).ConfigureAwait(false);
await hasIdentity.FindIdentities(ProviderManager, cancellationToken).ConfigureAwait(false);
}
catch (Exception ex)
{

@ -251,7 +251,9 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.ChildCount = GetChildCount(folder, user);
if (!(folder is UserRootFolder))
// These are just far too slow.
// TODO: Disable for CollectionFolder
if (!(folder is UserRootFolder) && !(folder is UserView))
{
SetSpecialCounts(folder, user, dto, fields);
}

Loading…
Cancel
Save