From 5c9f70c3752bd7297cb85bdc7ce748363a16ad8b Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Wed, 30 Apr 2025 09:29:13 +0200 Subject: Cleanup Tasks and Validators --- .../ScheduledTasks/Tasks/PeopleValidationTask.cs | 94 +++++++++++----------- 1 file changed, 45 insertions(+), 49 deletions(-) (limited to 'Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs') diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs index 2907f18b5..18162ad2f 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/PeopleValidationTask.cs @@ -6,68 +6,64 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Tasks; -namespace Emby.Server.Implementations.ScheduledTasks.Tasks +namespace Emby.Server.Implementations.ScheduledTasks.Tasks; + +/// +/// Class PeopleValidationTask. +/// +public class PeopleValidationTask : IScheduledTask, IConfigurableScheduledTask { + private readonly ILibraryManager _libraryManager; + private readonly ILocalizationManager _localization; + /// - /// Class PeopleValidationTask. + /// Initializes a new instance of the class. /// - public class PeopleValidationTask : IScheduledTask, IConfigurableScheduledTask + /// Instance of the interface. + /// Instance of the interface. + public PeopleValidationTask(ILibraryManager libraryManager, ILocalizationManager localization) { - private readonly ILibraryManager _libraryManager; - private readonly ILocalizationManager _localization; - - /// - /// Initializes a new instance of the class. - /// - /// Instance of the interface. - /// Instance of the interface. - public PeopleValidationTask(ILibraryManager libraryManager, ILocalizationManager localization) - { - _libraryManager = libraryManager; - _localization = localization; - } + _libraryManager = libraryManager; + _localization = localization; + } - /// - public string Name => _localization.GetLocalizedString("TaskRefreshPeople"); + /// + public string Name => _localization.GetLocalizedString("TaskRefreshPeople"); - /// - public string Description => _localization.GetLocalizedString("TaskRefreshPeopleDescription"); + /// + public string Description => _localization.GetLocalizedString("TaskRefreshPeopleDescription"); - /// - public string Category => _localization.GetLocalizedString("TasksLibraryCategory"); + /// + public string Category => _localization.GetLocalizedString("TasksLibraryCategory"); - /// - public string Key => "RefreshPeople"; + /// + public string Key => "RefreshPeople"; - /// - public bool IsHidden => false; + /// + public bool IsHidden => false; - /// - public bool IsEnabled => true; + /// + public bool IsEnabled => true; - /// - public bool IsLogged => true; + /// + public bool IsLogged => true; - /// - /// Creates the triggers that define when the task will run. - /// - /// An containing the default trigger infos for this task. - public IEnumerable GetDefaultTriggers() + /// + /// Creates the triggers that define when the task will run. + /// + /// An containing the default trigger infos for this task. + public IEnumerable GetDefaultTriggers() + { + yield return new TaskTriggerInfo { - return new[] - { - new TaskTriggerInfo - { - Type = TaskTriggerInfoType.IntervalTrigger, - IntervalTicks = TimeSpan.FromDays(7).Ticks - } - }; - } + Type = TaskTriggerInfoType.IntervalTrigger, + IntervalTicks = TimeSpan.FromDays(7).Ticks + }; + } - /// - public Task ExecuteAsync(IProgress progress, CancellationToken cancellationToken) - { - return _libraryManager.ValidatePeopleAsync(progress, cancellationToken); - } + /// + public Task ExecuteAsync(IProgress progress, CancellationToken cancellationToken) + { + return _libraryManager.ValidatePeopleAsync(progress, cancellationToken); } } -- cgit v1.2.3