diff options
| author | JP Dillingham <jp@dillingham.me> | 2023-10-15 15:29:20 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2023-10-15 15:29:20 -0500 |
| commit | bd8fe8eb32dc6550d23bd2840b37797e7fc70c48 (patch) | |
| tree | 46630f3e0ffb8ed6c5289dc37946ae5bf47b662e /src/slskd/Core | |
| parent | 5986bcadc179e3e9a34152687b80210dcc65e366 (diff) | |
| download | slskd-bd8fe8eb32dc6550d23bd2840b37797e7fc70c48.tar.gz | |
move transfer retention options
Diffstat (limited to 'src/slskd/Core')
| -rw-r--r-- | src/slskd/Core/Options.cs | 76 |
1 files changed, 44 insertions, 32 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 9d92bb95..2b9c3455 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -1060,22 +1060,16 @@ namespace slskd public class RetentionOptions { /// <summary> - /// Gets file retention options. - /// </summary> - [Validate] - public FileRetentionOptions Files { get; init; } = new FileRetentionOptions(); - - /// <summary> - /// Gets upload retention options. + /// Gets transfer retention options. /// </summary> [Validate] - public TransferRetentionOptions Upload { get; init; } = new TransferRetentionOptions(); + public TransferRetentionOptions Transfers { get; init; } = new TransferRetentionOptions(); /// <summary> - /// Gets download retention options. + /// Gets file retention options. /// </summary> [Validate] - public TransferRetentionOptions Download { get; init; } = new TransferRetentionOptions(); + public FileRetentionOptions Files { get; init; } = new FileRetentionOptions(); /// <summary> /// Gets the time to retain logs, in days. @@ -1084,45 +1078,63 @@ namespace slskd public int Logs { get; init; } = 180; /// <summary> - /// File retention options. + /// Transfer retention options. /// </summary> - public class FileRetentionOptions + public class TransferRetentionOptions { /// <summary> - /// Gets the time to retain completed files, in minutes. + /// Gets upload retention options. /// </summary> - [Range(30, maximum: int.MaxValue)] - public int? Complete { get; init; } = null; + [Validate] + public TransferTypeRetentionOptions Upload { get; init; } = new TransferTypeRetentionOptions(); /// <summary> - /// Gets the time to retain incomplete files, in minutes. + /// Gets download retention options. /// </summary> - [Range(30, maximum: int.MaxValue)] - public int? Incomplete { get; init; } = null; + [Validate] + public TransferTypeRetentionOptions Download { get; init; } = new TransferTypeRetentionOptions(); + + /// <summary> + /// Transfer retention options. + /// </summary> + public class TransferTypeRetentionOptions + { + /// <summary> + /// Gets the time to retain successful transfers, in minutes. + /// </summary> + [Range(5, maximum: int.MaxValue)] + public int? Succeeded { get; init; } = null; + + /// <summary> + /// Gets the time to retain errored transfers, in minutes. + /// </summary> + [Range(5, maximum: int.MaxValue)] + public int? Errored { get; init; } = null; + + /// <summary> + /// Gets the time to retain cancelled transfers, in minutes. + /// </summary> + [Range(5, maximum: int.MaxValue)] + public int? Cancelled { get; init; } = null; + } } /// <summary> - /// Transfer retention options. + /// File retention options. /// </summary> - public class TransferRetentionOptions + public class FileRetentionOptions { /// <summary> - /// Gets the time to retain successful transfers, in minutes. - /// </summary> - [Range(5, maximum: int.MaxValue)] - public int? Succeeded { get; init; } = null; - - /// <summary> - /// Gets the time to retain errored transfers, in minutes. + /// Gets the time to retain completed files, in minutes. /// </summary> - [Range(5, maximum: int.MaxValue)] - public int? Errored { get; init; } = null; + [Range(30, maximum: int.MaxValue)] + public int? Complete { get; init; } = null; /// <summary> - /// Gets the time to retain cancelled transfers, in minutes. + /// Gets the time to retain incomplete files, in minutes. /// </summary> - [Range(5, maximum: int.MaxValue)] - public int? Cancelled { get; init; } = null; + [Range(30, maximum: int.MaxValue)] + public int? Incomplete { get; init; } = null; } } |
