The Free Software Media System - Server Backend & API
update album refresh
Luke Pulverenti6858ff4493e0
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.csindex 615276e837..1f3b0c92a5 100644--- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs@@ -179,17 +179,13 @@ namespace MediaBrowser.Controller.Entities.Audio{var items = GetRecursiveChildren().ToList();- var songs = items.OfType<Audio>().ToList();-- var others = items.Except(songs).ToList();-- var totalItems = songs.Count + others.Count;+ var totalItems = items.Count;var numComplete = 0;var childUpdateType = ItemUpdateType.None;// Refresh songs- foreach (var item in songs)+ foreach (var item in items){cancellationToken.ThrowIfCancellationRequested();@@ -199,7 +195,7 @@ namespace MediaBrowser.Controller.Entities.AudionumComplete++;double percent = numComplete;percent /= totalItems;- progress.Report(percent * 100);+ progress.Report(percent * 95);}var parentRefreshOptions = refreshOptions;@@ -212,19 +208,6 @@ namespace MediaBrowser.Controller.Entities.Audio// Refresh current itemawait RefreshMetadata(parentRefreshOptions, cancellationToken).ConfigureAwait(false);- // Refresh all non-songs- foreach (var item in others)- {- cancellationToken.ThrowIfCancellationRequested();-- var updateType = await item.RefreshMetadata(parentRefreshOptions, cancellationToken).ConfigureAwait(false);-- numComplete++;- double percent = numComplete;- percent /= totalItems;- progress.Report(percent * 100);- }-progress.Report(100);}}diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.csindex e79c465a11..eb0a11205b 100644--- a/MediaBrowser.Controller/Entities/TV/Series.cs+++ b/MediaBrowser.Controller/Entities/TV/Series.cs@@ -283,9 +283,6 @@ namespace MediaBrowser.Controller.Entities.TVvar totalItems = seasons.Count + otherItems.Count;var numComplete = 0;- refreshOptions = new MetadataRefreshOptions(refreshOptions);- refreshOptions.IsPostRecursiveRefresh = true;-// Refresh current itemawait RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);@@ -315,7 +312,7 @@ namespace MediaBrowser.Controller.Entities.TV&& refreshOptions.MetadataRefreshMode != MetadataRefreshMode.FullRefresh&& !refreshOptions.ReplaceAllMetadata&& episode.IsMissingEpisode- && episode.LocationType == Model.Entities.LocationType.Virtual+ && episode.LocationType == LocationType.Virtual&& episode.PremiereDate.HasValue&& (DateTime.UtcNow - episode.PremiereDate.Value).TotalDays > 30){@@ -333,6 +330,8 @@ namespace MediaBrowser.Controller.Entities.TVprogress.Report(percent * 100);}+ refreshOptions = new MetadataRefreshOptions(refreshOptions);+ refreshOptions.IsPostRecursiveRefresh = true;await ProviderManager.RefreshSingleItem(this, refreshOptions, cancellationToken).ConfigureAwait(false);progress.Report(100);