diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs b/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs index 5c43f2e13..843080950 100644 --- a/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs +++ b/MediaBrowser.Server.Implementations/Library/Validators/PeopleValidator.cs @@ -89,7 +89,7 @@ namespace MediaBrowser.Server.Implementations.Library.Validators var peopleOptions = _config.Configuration.PeopleMetadataOptions; - var people = _libraryManager.GetAllPeople(); + var people = _libraryManager.GetPeople(new InternalPeopleQuery()); var dict = new Dictionary<string, bool>(StringComparer.OrdinalIgnoreCase); @@ -112,8 +112,9 @@ namespace MediaBrowser.Server.Implementations.Library.Validators } var numComplete = 0; - var validIds = new List<Guid>(); - + + _logger.Debug("Will refresh {0} people", dict.Count); + foreach (var person in dict) { cancellationToken.ThrowIfCancellationRequested(); @@ -122,10 +123,9 @@ namespace MediaBrowser.Server.Implementations.Library.Validators { var item = _libraryManager.GetPerson(person.Key); - validIds.Add(item.Id); - var hasMetdata = !string.IsNullOrWhiteSpace(item.Overview); - var performFullRefresh = !hasMetdata && (DateTime.UtcNow - item.DateLastRefreshed).TotalDays >= 30; + var performFullRefresh = !hasMetdata && (DateTime.UtcNow - item.DateLastRefreshed).TotalDays >= 90; + performFullRefresh = false; var defaultMetadataRefreshMode = performFullRefresh ? MetadataRefreshMode.FullRefresh @@ -160,31 +160,6 @@ namespace MediaBrowser.Server.Implementations.Library.Validators progress.Report(100 * percent); } - var allIds = _libraryManager.GetItemIds(new InternalItemsQuery - { - IncludeItemTypes = new[] { typeof(Person).Name } - }); - - var invalidIds = allIds - .Except(validIds) - .ToList(); - - foreach (var id in invalidIds) - { - cancellationToken.ThrowIfCancellationRequested(); - - var item = _libraryManager.GetItemById(id); - - if (item != null) - { - await _libraryManager.DeleteItem(item, new DeleteOptions - { - DeleteFileLocation = false - - }).ConfigureAwait(false); - } - } - progress.Report(100); _logger.Info("People validation complete"); |
