diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs index a149da651..72864790b 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs @@ -34,21 +34,22 @@ namespace MediaBrowser.Server.Implementations.Library.Validators /// <returns>Task.</returns> public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) { - var items = _libraryManager.RootFolder.GetRecursiveChildren(i => i is Game) - .SelectMany(i => i.Genres) - .DistinctNames() + var items = _libraryManager.GetGameGenres(new InternalItemsQuery + { + IncludeItemTypes = new[] { typeof(Game).Name } + }) + .Items + .Select(i => i.Item1) .ToList(); var numComplete = 0; var count = items.Count; - foreach (var name in items) + foreach (var item in items) { try { - var itemByName = _libraryManager.GetGameGenre(name); - - await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false); + await item.RefreshMetadata(cancellationToken).ConfigureAwait(false); } catch (OperationCanceledException) { @@ -57,7 +58,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators } catch (Exception ex) { - _logger.ErrorException("Error refreshing {0}", ex, name); + _logger.ErrorException("Error refreshing {0}", ex, item.Name); } numComplete++; |
