using MediaBrowser.Common.ScheduledTasks;
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Controller.ScheduledTasks
{
///
/// Class PeopleValidationTask
///
[Export(typeof(IScheduledTask))]
public class PeopleValidationTask : BaseScheduledTask
{
///
/// Creates the triggers that define when the task will run
///
/// IEnumerable{BaseTaskTrigger}.
protected override IEnumerable GetDefaultTriggers()
{
return new BaseTaskTrigger[]
{
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";
}
}
}
}