aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-08-06 00:38:01 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-08-06 00:38:01 -0400
commit319a956b3870e162b3072b52ea8c7310d5091bc6 (patch)
tree7f5bce885e50f23bc0c586d39c7e91bc55269318 /MediaBrowser.Server.Implementations/Library/Validators/GameGenresValidator.cs
parent407d82ea11383f55d2187a69c9711ee7511ee0e3 (diff)
update validators
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 a149da6510..72864790b8 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++;