mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-20 07:45:26 +03:00
plugin security fixes and other abstractions
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using MediaBrowser.Common.ScheduledTasks;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
@@ -10,23 +9,24 @@ namespace MediaBrowser.Controller.ScheduledTasks
|
||||
/// <summary>
|
||||
/// Class PeopleValidationTask
|
||||
/// </summary>
|
||||
public class PeopleValidationTask : BaseScheduledTask<Kernel>
|
||||
public class PeopleValidationTask : IScheduledTask
|
||||
{
|
||||
private readonly Kernel _kernel;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PeopleValidationTask" /> class.
|
||||
/// </summary>
|
||||
/// <param name="kernel">The kernel.</param>
|
||||
/// <param name="logger"></param>
|
||||
public PeopleValidationTask(Kernel kernel, ITaskManager taskManager, ILogger logger)
|
||||
: base(kernel, taskManager, logger)
|
||||
public PeopleValidationTask(Kernel kernel)
|
||||
{
|
||||
_kernel = kernel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the triggers that define when the task will run
|
||||
/// </summary>
|
||||
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
|
||||
public override IEnumerable<ITaskTrigger> GetDefaultTriggers()
|
||||
public IEnumerable<ITaskTrigger> GetDefaultTriggers()
|
||||
{
|
||||
return new ITaskTrigger[]
|
||||
{
|
||||
@@ -42,16 +42,16 @@ namespace MediaBrowser.Controller.ScheduledTasks
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <param name="progress">The progress.</param>
|
||||
/// <returns>Task.</returns>
|
||||
protected override Task ExecuteInternal(CancellationToken cancellationToken, IProgress<double> progress)
|
||||
public Task Execute(CancellationToken cancellationToken, IProgress<double> progress)
|
||||
{
|
||||
return Kernel.LibraryManager.ValidatePeople(cancellationToken, progress);
|
||||
return _kernel.LibraryManager.ValidatePeople(cancellationToken, progress);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the task
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public override string Name
|
||||
public string Name
|
||||
{
|
||||
get { return "Refresh people"; }
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace MediaBrowser.Controller.ScheduledTasks
|
||||
/// Gets the description.
|
||||
/// </summary>
|
||||
/// <value>The description.</value>
|
||||
public override string Description
|
||||
public string Description
|
||||
{
|
||||
get { return "Updates metadata for actors, artists and directors in your media library."; }
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace MediaBrowser.Controller.ScheduledTasks
|
||||
/// Gets the category.
|
||||
/// </summary>
|
||||
/// <value>The category.</value>
|
||||
public override string Category
|
||||
public string Category
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user