aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.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/GenresValidator.cs
parent407d82ea11383f55d2187a69c9711ee7511ee0e3 (diff)
update validators
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs17
1 files changed, 9 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs
index fac5cfc356..6a62d7fe47 100644
--- a/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs
+++ b/MediaBrowser.Server.Implementations/Library/Validators/GenresValidator.cs
@@ -35,21 +35,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 IHasMusicGenres) && !(i is Game))
- .SelectMany(i => i.Genres)
- .DistinctNames()
+ var items = _libraryManager.GetGenres(new InternalItemsQuery
+ {
+ ExcludeItemTypes = new[] { typeof(Audio).Name, typeof(MusicArtist).Name, typeof(MusicAlbum).Name, typeof(MusicVideo).Name, 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.GetGenre(name);
-
- await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false);
+ await item.RefreshMetadata(cancellationToken).ConfigureAwait(false);
}
catch (OperationCanceledException)
{
@@ -58,7 +59,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++;