aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-08-07 17:17:05 -0400
committerGitHub <noreply@github.com>2016-08-07 17:17:05 -0400
commit2026a682ed363338ec6a27f099b0788f33be46f8 (patch)
tree4113625119679c2264edf13d266150a7041cfc8e /MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs
parentdaf2d41c9d1ac4c6f6baf10b2ed850aa4f5b9b30 (diff)
parenta86336ebc6913489f7e30b8fdf02947397b01bcb (diff)
Merge pull request #2037 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs17
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++;