mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-26 03:57:12 +00:00
minor changes to transcode cleanup scheduled task
This commit is contained in:
@@ -1446,7 +1446,7 @@ namespace Emby.Server.Implementations
|
||||
CanSelfRestart = CanSelfRestart,
|
||||
CanLaunchWebBrowser = CanLaunchWebBrowser,
|
||||
HasUpdateAvailable = HasUpdateAvailable,
|
||||
TranscodingTempPath = ApplicationPaths.TranscodingTempPath,
|
||||
TranscodingTempPath = ApplicationPaths.TranscodePath,
|
||||
ServerName = FriendlyName,
|
||||
LocalAddress = localAddress,
|
||||
SupportsLibraryMonitor = true,
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Emby.Server.Implementations.Configuration
|
||||
{
|
||||
var encodingConfig = this.GetConfiguration<EncodingOptions>("encoding");
|
||||
|
||||
((ServerApplicationPaths)ApplicationPaths).TranscodingTempPath = string.IsNullOrEmpty(encodingConfig.TranscodingTempPath) ?
|
||||
((ServerApplicationPaths)ApplicationPaths).TranscodePath = string.IsNullOrEmpty(encodingConfig.TranscodingTempPath) ?
|
||||
null :
|
||||
Path.Combine(encodingConfig.TranscodingTempPath, "transcodes");
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
||||
|
||||
protected void SetTempFilePath(string extension)
|
||||
{
|
||||
TempFilePath = Path.Combine(AppPaths.GetTranscodingTempPath(), UniqueId + "." + extension);
|
||||
TempFilePath = Path.Combine(AppPaths.GetTranscodePath(), UniqueId + "." + extension);
|
||||
}
|
||||
|
||||
public virtual Task Open(CancellationToken openCancellationToken)
|
||||
|
||||
@@ -39,7 +39,13 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||
/// 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()
|
||||
{
|
||||
yield return new TaskTriggerInfo
|
||||
{
|
||||
Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the task to be executed
|
||||
@@ -54,7 +60,7 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||
|
||||
try
|
||||
{
|
||||
DeleteTempFilesFromDirectory(cancellationToken, ApplicationPaths.TranscodingTempPath, minDateModified, progress);
|
||||
DeleteTempFilesFromDirectory(cancellationToken, ApplicationPaths.TranscodePath, minDateModified, progress);
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
@@ -138,17 +144,17 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
||||
}
|
||||
}
|
||||
|
||||
public string Name => "Transcoding temp cleanup";
|
||||
public string Name => "Transcode file cleanup";
|
||||
|
||||
public string Description => "Deletes transcoding temp files older than 24 hours.";
|
||||
public string Description => "Deletes transcode files more than 24 hours old.";
|
||||
|
||||
public string Category => "Maintenance";
|
||||
|
||||
public string Key => "DeleteTranscodingTempFiles";
|
||||
public string Key => "DeleteTranscodeFiles";
|
||||
|
||||
public bool IsHidden => false;
|
||||
|
||||
public bool IsEnabled => false;
|
||||
public bool IsEnabled => true;
|
||||
|
||||
public bool IsLogged => true;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Emby.Server.Implementations
|
||||
public class ServerApplicationPaths : BaseApplicationPaths, IServerApplicationPaths
|
||||
{
|
||||
private string _defaultTranscodingTempPath;
|
||||
private string _transcodingTempPath;
|
||||
private string _transcodePath;
|
||||
private string _internalMetadataPath;
|
||||
|
||||
/// <summary>
|
||||
@@ -107,19 +107,19 @@ namespace Emby.Server.Implementations
|
||||
/// <value>The user configuration directory path.</value>
|
||||
public string UserConfigurationDirectoryPath => Path.Combine(ConfigurationDirectoryPath, "users");
|
||||
|
||||
public string DefaultTranscodingTempPath => _defaultTranscodingTempPath ?? (_defaultTranscodingTempPath = Path.Combine(ProgramDataPath, "transcoding-temp"));
|
||||
public string DefaultTranscodePath => _defaultTranscodingTempPath ?? (_defaultTranscodingTempPath = Path.Combine(ProgramDataPath, "transcodes"));
|
||||
|
||||
public string TranscodingTempPath
|
||||
public string TranscodePath
|
||||
{
|
||||
get => _transcodingTempPath ?? (_transcodingTempPath = DefaultTranscodingTempPath);
|
||||
set => _transcodingTempPath = value;
|
||||
get => _transcodePath ?? (_transcodePath = DefaultTranscodePath);
|
||||
set => _transcodePath = value;
|
||||
}
|
||||
|
||||
public string GetTranscodingTempPath()
|
||||
public string GetTranscodePath()
|
||||
{
|
||||
var path = TranscodingTempPath;
|
||||
var path = TranscodePath;
|
||||
|
||||
if (!string.Equals(path, DefaultTranscodingTempPath, StringComparison.OrdinalIgnoreCase))
|
||||
if (!string.Equals(path, DefaultTranscodePath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -136,7 +136,7 @@ namespace Emby.Server.Implementations
|
||||
}
|
||||
}
|
||||
|
||||
path = DefaultTranscodingTempPath;
|
||||
path = DefaultTranscodePath;
|
||||
Directory.CreateDirectory(path);
|
||||
return path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user