aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Core
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-02-10 17:57:19 -0600
committerGitHub <noreply@github.com>2024-02-10 17:57:19 -0600
commitcb226f4d31a97d9e60d6dd90d995f89ca57a3ee5 (patch)
treeadea2e1baa93a69651254df9666a867ce8dbc2a9 /src/slskd/Core
parent9615aef899fe426cf3b4f95672b2d080032ff30f (diff)
parent05c87aa51f73cbbc66688482c0224865b7c6c1a4 (diff)
downloadslskd-cb226f4d31a97d9e60d6dd90d995f89ca57a3ee5.tar.gz
Merge pull request #1079 from slskd/limit-docs
Add global limits, add limits to configuration documentation
Diffstat (limited to 'src/slskd/Core')
-rw-r--r--src/slskd/Core/Options.cs102
1 files changed, 54 insertions, 48 deletions
diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs
index 68f3c3dc..992541bc 100644
--- a/src/slskd/Core/Options.cs
+++ b/src/slskd/Core/Options.cs
@@ -787,6 +787,12 @@ namespace slskd
public GlobalUploadOptions Upload { get; init; } = new GlobalUploadOptions();
/// <summary>
+ /// Gets global limits.
+ /// </summary>
+ [Validate]
+ public LimitsOptions Limits { get; init; } = new LimitsOptions();
+
+ /// <summary>
/// Gets global download options.
/// </summary>
[Validate]
@@ -844,6 +850,54 @@ namespace slskd
}
/// <summary>
+ /// Limit options.
+ /// </summary>
+ public class LimitsOptions
+ {
+ /// <summary>
+ /// Gets limits for queued transfers.
+ /// </summary>
+ [Validate]
+ public Limits Queued { get; init; } = new Limits();
+
+ /// <summary>
+ /// Gets daily limits for transfers.
+ /// </summary>
+ [Validate]
+ public Limits Daily { get; init; } = new Limits();
+
+ /// <summary>
+ /// Gets weekly limits for transfers.
+ /// </summary>
+ [Validate]
+ public Limits Weekly { get; init; } = new Limits();
+
+ /// <summary>
+ /// Limits.
+ /// </summary>
+ public class Limits
+ {
+ /// <summary>
+ /// Gets the limit for number of files.
+ /// </summary>
+ [Range(1, int.MaxValue)]
+ public int? Files { get; init; } = null;
+
+ /// <summary>
+ /// Gets the limit for number of megabytes.
+ /// </summary>
+ [Range(1, int.MaxValue)]
+ public int? Megabytes { get; init; } = null;
+
+ /// <summary>
+ /// Gets the limit for number of failures.
+ /// </summary>
+ [Range(1, int.MaxValue)]
+ public int? Failures { get; init; } = null;
+ }
+ }
+
+ /// <summary>
/// User groups.
/// </summary>
public class GroupsOptions : IValidatableObject
@@ -1027,54 +1081,6 @@ namespace slskd
[Range(1, int.MaxValue)]
public int SpeedLimit { get; init; } = int.MaxValue;
}
-
- /// <summary>
- /// Upload limit options.
- /// </summary>
- public class LimitsOptions
- {
- /// <summary>
- /// Gets limits for queued transfers.
- /// </summary>
- [Validate]
- public LimitsExtendedOptions Queued { get; init; } = new LimitsExtendedOptions();
-
- /// <summary>
- /// Gets daily limits for transfers.
- /// </summary>
- [Validate]
- public LimitsExtendedOptions Daily { get; init; } = new LimitsExtendedOptions();
-
- /// <summary>
- /// Gets weekly limits for transfers.
- /// </summary>
- [Validate]
- public LimitsExtendedOptions Weekly { get; init; } = new LimitsExtendedOptions();
- }
-
- /// <summary>
- /// Extended limit options.
- /// </summary>
- public class LimitsExtendedOptions
- {
- /// <summary>
- /// Gets the limit for number of files.
- /// </summary>
- [Range(1, int.MaxValue)]
- public int? Files { get; init; } = null;
-
- /// <summary>
- /// Gets the limit for number of megabytes.
- /// </summary>
- [Range(1, int.MaxValue)]
- public int? Megabytes { get; init; } = null;
-
- /// <summary>
- /// Gets the limit for number of failures.
- /// </summary>
- [Range(1, int.MaxValue)]
- public int? Failures { get; init; } = null;
- }
}
/// <summary>