The Free Software Media System - Server Backend & API
Set DeleteTranscodeFileTask to trigger every 24h
crobiberobf66f57069e1
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteTranscodeFileTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteTranscodeFileTask.csindex 26ef193542..b13fc7fc68 100644--- a/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteTranscodeFileTask.cs+++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/DeleteTranscodeFileTask.cs@@ -5,10 +5,10 @@ using System.Linq;using System.Threading;using System.Threading.Tasks;using MediaBrowser.Common.Configuration;+using MediaBrowser.Model.Globalization;using MediaBrowser.Model.IO;using MediaBrowser.Model.Tasks;using Microsoft.Extensions.Logging;-using MediaBrowser.Model.Globalization;namespace Emby.Server.Implementations.ScheduledTasks.Tasks{@@ -23,8 +23,12 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasksprivate readonly ILocalizationManager _localization;/// <summary>- /// Initializes a new instance of the <see cref="DeleteTranscodeFileTask" /> class.+ /// Initializes a new instance of the <see cref="DeleteTranscodeFileTask"/> class./// </summary>+ /// <param name="logger">Instance of the <see cref="ILogger{DeleteTranscodeFileTask}"/> interface.</param>+ /// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>+ /// <param name="configurationManager">Instance of the <see cref="IConfigurationManager"/> interface.</param>+ /// <param name="localization">Instance of the <see cref="ILocalizationManager"/> interface.</param>public DeleteTranscodeFileTask(ILogger<DeleteTranscodeFileTask> logger,IFileSystem fileSystem,@@ -37,11 +41,42 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks_localization = localization;}+ /// <inheritdoc />+ public string Name => _localization.GetLocalizedString("TaskCleanTranscode");++ /// <inheritdoc />+ public string Description => _localization.GetLocalizedString("TaskCleanTranscodeDescription");++ /// <inheritdoc />+ public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");++ /// <inheritdoc />+ public string Key => "DeleteTranscodeFiles";++ /// <inheritdoc />+ public bool IsHidden => false;++ /// <inheritdoc />+ public bool IsEnabled => true;++ /// <inheritdoc />+ public bool IsLogged => true;+/// <summary>/// Creates the triggers that define when the task will run./// </summary>/// <returns>IEnumerable{BaseTaskTrigger}.</returns>- public IEnumerable<TaskTriggerInfo> GetDefaultTriggers() => new List<TaskTriggerInfo>();+ public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()+ {+ return new[]+ {+ new TaskTriggerInfo+ {+ Type = TaskTriggerInfo.TriggerInterval,+ IntervalTicks = TimeSpan.FromHours(24).Ticks+ }+ };+ }/// <summary>/// Returns the task to be executed.@@ -131,26 +166,5 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks_logger.LogError(ex, "Error deleting file {path}", path);}}-- /// <inheritdoc />- public string Name => _localization.GetLocalizedString("TaskCleanTranscode");-- /// <inheritdoc />- public string Description => _localization.GetLocalizedString("TaskCleanTranscodeDescription");-- /// <inheritdoc />- public string Category => _localization.GetLocalizedString("TasksMaintenanceCategory");-- /// <inheritdoc />- public string Key => "DeleteTranscodeFiles";-- /// <inheritdoc />- public bool IsHidden => false;-- /// <inheritdoc />- public bool IsEnabled => true;-- /// <inheritdoc />- public bool IsLogged => true;}}