diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs index 11d4c9f16..fac5cfc35 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Logging; @@ -44,16 +43,12 @@ namespace MediaBrowser.Server.Implementations.Library.Validators var numComplete = 0; var count = items.Count; - var validIds = new List<Guid>(); - foreach (var name in items) { try { var itemByName = _libraryManager.GetGenre(name); - validIds.Add(itemByName.Id); - await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false); } catch (OperationCanceledException) @@ -74,28 +69,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators progress.Report(percent); } - var allIds = _libraryManager.GetItemIds(new InternalItemsQuery - { - IncludeItemTypes = new[] { typeof(Genre).Name } - }); - - var invalidIds = allIds - .Except(validIds) - .ToList(); - - foreach (var id in invalidIds) - { - cancellationToken.ThrowIfCancellationRequested(); - - var item = _libraryManager.GetItemById(id); - - await _libraryManager.DeleteItem(item, new DeleteOptions - { - DeleteFileLocation = false - - }).ConfigureAwait(false); - } - progress.Report(100); } } |
