From 71d8972ecda9664cfeb4788609e23d7dd9752f92 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 30 Dec 2023 18:43:03 -0600 Subject: add limits options --- src/slskd/Core/Options.cs | 66 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/slskd/Core/Options.cs b/src/slskd/Core/Options.cs index 94f8618d..8c4be6ef 100644 --- a/src/slskd/Core/Options.cs +++ b/src/slskd/Core/Options.cs @@ -891,6 +891,12 @@ namespace slskd /// [Validate] public UploadOptions Upload { get; init; } = new UploadOptions(); + + /// + /// Gets limit options. + /// + [Validate] + public LimitsOptions Limits { get; init; } = new LimitsOptions(); } /// @@ -949,6 +955,12 @@ namespace slskd /// [Validate] public UploadOptions Upload { get; init; } = new UploadOptions(); + + /// + /// Gets limit options. + /// + [Validate] + public LimitsOptions Limits { get; init; } = new LimitsOptions(); } /// @@ -980,6 +992,12 @@ namespace slskd [Validate] public UploadOptions Upload { get; init; } = new UploadOptions(); + /// + /// Gets limit options. + /// + [Validate] + public LimitsOptions Limits { get; init; } = new LimitsOptions(); + /// /// Gets the list of group member usernames. /// @@ -1015,6 +1033,54 @@ namespace slskd [Range(1, int.MaxValue)] public int SpeedLimit { get; init; } = int.MaxValue; } + + /// + /// Upload limit options. + /// + public class LimitsOptions + { + /// + /// Gets limits for queued transfers. + /// + [Validate] + public LimitsExtendedOptions Queued { get; init; } = new LimitsExtendedOptions(); + + /// + /// Gets daily limits for transfers. + /// + [Validate] + public LimitsExtendedOptions Daily { get; init; } = new LimitsExtendedOptions(); + + /// + /// Gets weekly limits for transfers. + /// + [Validate] + public LimitsExtendedOptions Weekly { get; init; } = new LimitsExtendedOptions(); + } + + /// + /// Extended limit options. + /// + public class LimitsExtendedOptions + { + /// + /// Gets the limit for number of files. + /// + [Range(1, int.MaxValue)] + public int? Files { get; init; } = null; + + /// + /// Gets the limit for number of directories. + /// + [Range(1, int.MaxValue)] + public int? Directories { get; init; } = null; + + /// + /// Gets the limit for number of megabytes. + /// + [Range(1, int.MaxValue)] + public int? Megabytes { get; init; } = null; + } } /// -- cgit v1.2.3