From 98eeffa1252bb832b51eca6ece1491d5bef859ec Mon Sep 17 00:00:00 2001 From: Mister Rajoy Date: Sun, 8 Nov 2020 17:36:50 +0100 Subject: [PATCH] Remove scheduled tasks --- .../ScheduledTasks/CssTasks.cs | 94 ------------------- 1 file changed, 94 deletions(-) delete mode 100644 Jellyfin.Plugin.SkinManager/ScheduledTasks/CssTasks.cs diff --git a/Jellyfin.Plugin.SkinManager/ScheduledTasks/CssTasks.cs b/Jellyfin.Plugin.SkinManager/ScheduledTasks/CssTasks.cs deleted file mode 100644 index 0dd52aa..0000000 --- a/Jellyfin.Plugin.SkinManager/ScheduledTasks/CssTasks.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using MediaBrowser.Controller.Library; -using MediaBrowser.Model.Tasks; -using Microsoft.Extensions.Logging; -using MediaBrowser.Model.Branding; -using MediaBrowser.Api; -using MediaBrowser.Controller.Configuration; -using MediaBrowser.Controller.Net; - -namespace Jellyfin.Plugin.SkinManager.ScheduledTasks -{ - public class SetCssTask : IScheduledTask - { - - private readonly CssManager _themeSongsManager; - private readonly ILogger _logger; - private readonly IServerConfigurationManager _serverConfigurationManager; - private readonly IHttpResultFactory _httpResultFactory; - private readonly BrandingOptions _branding; - - public SetCssTask(ILogger logger, IServerConfigurationManager serverConfigurationManager, IHttpResultFactory httpResultFactory) - { - _serverConfigurationManager = serverConfigurationManager; - _httpResultFactory = httpResultFactory; - _themeSongsManager = new CssManager(logger,serverConfigurationManager,httpResultFactory); - } - public Task Execute(CancellationToken cancellationToken, IProgress progress) - { - _logger.LogInformation("Starting plugin, Setting css"); - _themeSongsManager.setCss(); - _logger.LogInformation("Done"); - return Task.CompletedTask; - } - - public IEnumerable GetDefaultTriggers() - { - // Run this task every 24 hours - yield return new TaskTriggerInfo - { - Type = TaskTriggerInfo.TriggerInterval, - IntervalTicks = TimeSpan.FromHours(24).Ticks - }; - } - - public string Name => "SetCss"; - public string Key => "css"; - public string Description => "Scans all libraries to download Theme Songs"; - public string Category => "css"; - } - - - public class RemoveCss : IScheduledTask - { - private readonly CssManager _themeSongsManager; - private readonly ILogger _logger; - private readonly IServerConfigurationManager _serverConfigurationManager; - private readonly IHttpResultFactory _httpResultFactory; - private readonly BrandingOptions _branding; - - public RemoveCss(ILogger logger, BrandingOptions branding, IServerConfigurationManager serverConfigurationManager, IHttpResultFactory httpResultFactory) - { - // _logger = logger; - //_themeSongsManager = new CssManager(logger, branding); - } - public Task Execute(CancellationToken cancellationToken, IProgress progress) - { - _logger.LogInformation("Starting plugin, Downloading Theme Songs..."); - _themeSongsManager.removeCss(); - _logger.LogInformation("All theme songs downloaded"); - return Task.CompletedTask; - } - - public IEnumerable GetDefaultTriggers() - { - // Run this task every 24 hours - yield return new TaskTriggerInfo - { - Type = TaskTriggerInfo.TriggerInterval, - IntervalTicks = TimeSpan.FromHours(24).Ticks - }; - } - - public string Name => "Css2"; - public string Key => "removeCss"; - public string Description => "Scans all libraries to download Movies Theme Songs"; - public string Category => "Css"; - } - - - -}