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 --- .../Tasks/RefreshMediaLibraryTask.cs | 83 +++++++++++----------- 1 file changed, 41 insertions(+), 42 deletions(-) (limited to 'Emby.Server.Implementations/ScheduledTasks/Tasks/RefreshMediaLibraryTask.cs') diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/RefreshMediaLibraryTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/RefreshMediaLibraryTask.cs index 172448dde..c96843199 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/RefreshMediaLibraryTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/RefreshMediaLibraryTask.cs @@ -7,60 +7,59 @@ 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 RefreshMediaLibraryTask. +/// +public class RefreshMediaLibraryTask : IScheduledTask { /// - /// Class RefreshMediaLibraryTask. + /// The _library manager. /// - public class RefreshMediaLibraryTask : IScheduledTask - { - /// - /// The _library manager. - /// - private readonly ILibraryManager _libraryManager; - private readonly 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 RefreshMediaLibraryTask(ILibraryManager libraryManager, ILocalizationManager localization) - { - _libraryManager = libraryManager; - _localization = localization; - } + /// + /// Initializes a new instance of the class. + /// + /// Instance of the interface. + /// Instance of the interface. + public RefreshMediaLibraryTask(ILibraryManager libraryManager, ILocalizationManager localization) + { + _libraryManager = libraryManager; + _localization = localization; + } - /// - public string Name => _localization.GetLocalizedString("TaskRefreshLibrary"); + /// + public string Name => _localization.GetLocalizedString("TaskRefreshLibrary"); - /// - public string Description => _localization.GetLocalizedString("TaskRefreshLibraryDescription"); + /// + public string Description => _localization.GetLocalizedString("TaskRefreshLibraryDescription"); - /// - public string Category => _localization.GetLocalizedString("TasksLibraryCategory"); + /// + public string Category => _localization.GetLocalizedString("TasksLibraryCategory"); - /// - public string Key => "RefreshLibrary"; + /// + public string Key => "RefreshLibrary"; - /// - public IEnumerable GetDefaultTriggers() + /// + public IEnumerable GetDefaultTriggers() + { + yield return new TaskTriggerInfo { - yield return new TaskTriggerInfo - { - Type = TaskTriggerInfoType.IntervalTrigger, - IntervalTicks = TimeSpan.FromHours(12).Ticks - }; - } + Type = TaskTriggerInfoType.IntervalTrigger, + IntervalTicks = TimeSpan.FromHours(12).Ticks + }; + } - /// - public Task ExecuteAsync(IProgress progress, CancellationToken cancellationToken) - { - cancellationToken.ThrowIfCancellationRequested(); + /// + public Task ExecuteAsync(IProgress progress, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); - progress.Report(0); + progress.Report(0); - return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken); - } + return ((LibraryManager)_libraryManager).ValidateMediaLibraryInternal(progress, cancellationToken); } } -- cgit v1.2.3