aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core/Options.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2023-10-15 14:27:13 -0500
committerGitHub <noreply@github.com>2023-10-15 14:27:13 -0500
commit5986bcadc179e3e9a34152687b80210dcc65e366 (patch)
tree69c89224d513f513793ac415664b4b584c383a82 /src/slskd/Core/Options.cs
parent12e89983470a55e03f30f35002135b921183c72b (diff)
parent4670f2a708b48d3bb73021a3954b8ca76bf56aa5 (diff)
downloadslskd-5986bcadc179e3e9a34152687b80210dcc65e366.tar.gz
Merge pull request #978 from slskd/file-retention
Add automated removal of downloaded and incomplete files, and application logs
Diffstat (limited to 'src/slskd/Core/Options.cs')
-rw-r--r--src/slskd/Core/Options.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index 30297cac..9d92bb95 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -1060,6 +1060,12 @@ namespace slskd
public class RetentionOptions
{
/// <summary>
+ /// Gets file retention options.
+ /// </summary>
+ [Validate]
+ public FileRetentionOptions Files { get; init; } = new FileRetentionOptions();
+
+ /// <summary>
/// Gets upload retention options.
/// </summary>
[Validate]
@@ -1072,6 +1078,30 @@ namespace slskd
public TransferRetentionOptions Download { get; init; } = new TransferRetentionOptions();
/// <summary>
+ /// Gets the time to retain logs, in days.
+ /// </summary>
+ [Range(1, maximum: int.MaxValue)]
+ public int Logs { get; init; } = 180;
+
+ /// <summary>
+ /// File retention options.
+ /// </summary>
+ public class FileRetentionOptions
+ {
+ /// <summary>
+ /// Gets the time to retain completed files, in minutes.
+ /// </summary>
+ [Range(30, maximum: int.MaxValue)]
+ public int? Complete { get; init; } = null;
+
+ /// <summary>
+ /// Gets the time to retain incomplete files, in minutes.
+ /// </summary>
+ [Range(30, maximum: int.MaxValue)]
+ public int? Incomplete { get; init; } = null;
+ }
+
+ /// <summary>
/// Transfer retention options.
/// </summary>
public class TransferRetentionOptions