2014-03-09 22:14:44 +00:00
|
|
|
|
using MediaBrowser.Controller.Library;
|
2014-01-28 18:37:01 +00:00
|
|
|
|
using MediaBrowser.Controller.Providers;
|
2013-09-10 18:56:00 +00:00
|
|
|
|
using MediaBrowser.Model.Logging;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Server.Implementations.Library.Validators
|
|
|
|
|
{
|
|
|
|
|
class PeoplePostScanTask : ILibraryPostScanTask
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The _library manager
|
|
|
|
|
/// </summary>
|
|
|
|
|
private readonly ILibraryManager _libraryManager;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The _logger
|
|
|
|
|
/// </summary>
|
|
|
|
|
private readonly ILogger _logger;
|
|
|
|
|
|
2014-03-09 22:14:44 +00:00
|
|
|
|
public PeoplePostScanTask(ILibraryManager libraryManager, ILogger logger)
|
2013-09-10 18:56:00 +00:00
|
|
|
|
{
|
|
|
|
|
_libraryManager = libraryManager;
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Runs the specified progress.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="progress">The progress.</param>
|
|
|
|
|
/// <param name="cancellationToken">The cancellation token.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2013-09-11 17:54:59 +00:00
|
|
|
|
public Task Run(IProgress<double> progress, CancellationToken cancellationToken)
|
|
|
|
|
{
|
2014-03-09 22:14:44 +00:00
|
|
|
|
return new PeopleValidator(_libraryManager, _logger).ValidatePeople(cancellationToken, new MetadataRefreshOptions
|
2013-09-10 18:56:00 +00:00
|
|
|
|
{
|
2014-03-09 22:14:44 +00:00
|
|
|
|
ImageRefreshMode = ImageRefreshMode.ValidationOnly,
|
|
|
|
|
MetadataRefreshMode = MetadataRefreshMode.None
|
2013-09-10 18:56:00 +00:00
|
|
|
|
|
2014-03-09 22:14:44 +00:00
|
|
|
|
}, progress);
|
2013-09-10 18:56:00 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|