using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Model.Logging;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.ScheduledTasks
{
///
/// Class PeopleValidationTask
///
public class PeopleValidationTask : BaseScheduledTask
{
///
/// Initializes a new instance of the class.
///
/// The kernel.
///
public PeopleValidationTask(Kernel kernel, ITaskManager taskManager, ILogger logger)
: base(kernel, taskManager, logger)
{
}
///
/// Creates the triggers that define when the task will run
///
/// IEnumerable{BaseTaskTrigger}.
public override IEnumerable GetDefaultTriggers()
{
return new ITaskTrigger[]
{
new DailyTrigger { TimeOfDay = TimeSpan.FromHours(2) },
new IntervalTrigger{ Interval = TimeSpan.FromHours(12)}
};
}
///
/// Returns the task to be executed
///
/// The cancellation token.
/// The progress.
/// Task.
protected override Task ExecuteInternal(CancellationToken cancellationToken, IProgress progress)
{
return Kernel.LibraryManager.ValidatePeople(cancellationToken, progress);
}
///
/// Gets the name of the task
///
/// The name.
public override string Name
{
get { return "Refresh people"; }
}
///
/// Gets the description.
///
/// The description.
public override string Description
{
get { return "Updates metadata for actors, artists and directors in your media library."; }
}
///
/// Gets the category.
///
/// The category.
public override string Category
{
get
{
return "Library";
}
}
}
}