diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-08-06 00:48:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-06 00:48:52 -0400 |
| commit | 99ad574bb83296f004a54e20c2c9696dbdcb6eb0 (patch) | |
| tree | 99d6514058d992775f91a76e7f585196c9a50e9b /MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs | |
| parent | bfe746d4e08e9b5d8422856000f0479853df64e4 (diff) | |
| parent | 0706bd5237125c8b95a7b8fa1576aa061703a397 (diff) | |
Merge pull request #2027 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs index 259878566..722b74891 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/StudiosValidator.cs @@ -1,10 +1,10 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Model.Logging; using System; -using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Entities; namespace MediaBrowser.Server.Implementations.Library.Validators { @@ -34,21 +34,19 @@ namespace MediaBrowser.Server.Implementations.Library.Validators /// <returns>Task.</returns> public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) { - var items = _libraryManager.RootFolder.GetRecursiveChildren(i => true) - .SelectMany(i => i.Studios) - .DistinctNames() + var items = _libraryManager.GetStudios(new InternalItemsQuery()) + .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.GetStudio(name); - - await itemByName.RefreshMetadata(cancellationToken).ConfigureAwait(false); + await item.RefreshMetadata(cancellationToken).ConfigureAwait(false); } catch (OperationCanceledException) { @@ -57,7 +55,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++; |
