Only refresh metadata if extras changed

This commit is contained in:
Torsten 2019-02-20 16:39:49 +01:00
parent 268b099ca8
commit 2690ac299b

View File

@ -1476,16 +1476,19 @@ namespace MediaBrowser.Controller.Entities
var extrasChanged = !item.ExtraIds.SequenceEqual(newExtraIds);
var ownerId = item.Id;
var tasks = newExtras.Select(i =>
if (extrasChanged)
{
return RefreshMetadataForOwnedItem(i, true, new MetadataRefreshOptions(options), cancellationToken);
});
var ownerId = item.Id;
await Task.WhenAll(tasks).ConfigureAwait(false);
var tasks = newExtras.Select(i =>
{
return RefreshMetadataForOwnedItem(i, true, new MetadataRefreshOptions(options), cancellationToken);
});
item.ExtraIds = newExtraIds;
await Task.WhenAll(tasks).ConfigureAwait(false);
item.ExtraIds = newExtraIds;
}
return extrasChanged;
}