Only fire metadata savers when appropriate

This commit is contained in:
Luke Pulverenti
2013-06-24 21:22:21 -04:00
parent 12c6bc27f2
commit 92cd71143d
33 changed files with 389 additions and 164 deletions

View File

@@ -834,12 +834,15 @@ namespace MediaBrowser.Controller.Entities
cancellationToken.ThrowIfCancellationRequested();
// Get the result from the item task
var changed = await itemRefreshTask.ConfigureAwait(false);
var updateReason = await itemRefreshTask.ConfigureAwait(false);
var changed = updateReason.HasValue;
if (changed || forceSave || themeSongsChanged || themeVideosChanged || localTrailersChanged)
{
cancellationToken.ThrowIfCancellationRequested();
await LibraryManager.UpdateItem(this, cancellationToken).ConfigureAwait(false);
await LibraryManager.UpdateItem(this, updateReason ?? ItemUpdateType.Unspecified, cancellationToken).ConfigureAwait(false);
}
return changed;

View File

@@ -315,7 +315,9 @@ namespace MediaBrowser.Controller.Entities
ResolveArgs = null;
}
var changed = await ProviderManager.ExecuteMetadataProviders(this, cancellationToken, forceRefresh, allowSlowProviders).ConfigureAwait(false);
var updateReason = await ProviderManager.ExecuteMetadataProviders(this, cancellationToken, forceRefresh, allowSlowProviders).ConfigureAwait(false);
var changed = updateReason.HasValue;
if (changed || forceSave)
{