aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 2aadf206..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>