From ab656f0feed130a1e7e58509a794e08c68de664d Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 24 Jan 2022 08:05:13 -0600 Subject: add global download options --- src/slskd/Options.cs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src') diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index e63a3b48..7c9fae0a 100644 --- a/src/slskd/Options.cs +++ b/src/slskd/Options.cs @@ -401,6 +401,12 @@ namespace slskd [Validate] public GlobalUploadOptions Upload { get; init; } = new GlobalUploadOptions(); + /// + /// Gets global download options. + /// + [Validate] + public GlobalDownloadOptions Download { get; init; } = new GlobalDownloadOptions(); + /// /// Global upload options. /// @@ -415,6 +421,30 @@ namespace slskd [RequiresRestart] [Range(1, int.MaxValue)] public int Slots { get; init; } = 10; + + /// + /// Gets the total upload speed limit. + /// + [Argument(default, "upload-speed-limit")] + [EnvironmentVariable("UPLOAD_SPEED_LIMIT")] + [Description("the total upload speed limit")] + [Range(1, int.MaxValue)] + public int SpeedLimit { get; init; } = int.MaxValue; + } + + /// + /// Gets global download options. + /// + public class GlobalDownloadOptions + { + /// + /// Gets the total download speed limit. + /// + [Argument(default, "download-speed-limit")] + [EnvironmentVariable("DOWNLOAD_SPEED_LIMIT")] + [Description("the total download speed limit")] + [Range(1, int.MaxValue)] + public int SpeedLimit { get; init; } = int.MaxValue; } } -- cgit v1.2.3