diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-08-04 00:48:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-04 00:48:30 -0400 |
| commit | 87d7a7d85adc1f069019f2706aa34d266c22b221 (patch) | |
| tree | a16199201a02a1e51fff48e0d7a21aba6977708d /MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs | |
| parent | 73729ca2426234e70701c48569d23a7e1eede636 (diff) | |
| parent | 6af3bf94c027ae6f9c225cd4838589525378a5d0 (diff) | |
Merge pull request #2018 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs index 826154fac..a149da651 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs @@ -1,5 +1,4 @@ -using System.Collections.Generic; -using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Logging; using System; @@ -43,16 +42,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.GetGameGenre(name); - validIds.Add(itemByName.Id); - await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false); } catch (OperationCanceledException) @@ -73,28 +68,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators progress.Report(percent); } - var allIds = _libraryManager.GetItemIds(new InternalItemsQuery - { - IncludeItemTypes = new[] { typeof(GameGenre).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); } } |
