From 9aff760ef3f7d1f8db925a8a5078d1fb7e7184bb Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 28 Feb 2022 07:41:55 -0600 Subject: add threshold options for the leecher group --- src/slskd/Options.cs | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index 5bebeb68..83e72586 100644 --- a/src/slskd/Options.cs +++ b/src/slskd/Options.cs @@ -480,7 +480,7 @@ namespace slskd /// These options apply to users that have been identified as leechers, and have not been added as a member of any group. /// [Validate] - public BuiltInOptions Leechers { get; init; } = new BuiltInOptions(); + public LeecherOptions Leechers { get; init; } = new LeecherOptions(); /// /// Gets user defined groups and options. @@ -513,6 +513,42 @@ namespace slskd public UploadOptions Upload { get; init; } = new UploadOptions(); } + /// + /// Built in leecher group options. + /// + public class LeecherOptions + { + /// + /// Gets leecher threshold options. + /// + [Validate] + public ThresholdOptions Thresholds { get; init } = new ThresholdOptions(); + + /// + /// Gets upload options. + /// + [Validate] + public UploadOptions Upload { get; init; } = new UploadOptions(); + } + + /// + /// Leecher threshold options. + /// + public class ThresholdOptions + { + /// + /// Gets the minimum number of shared files required to avoid being classified as a leecher. + /// + [Range(1, int.MaxValue)] + public int Files { get; init; } = 1; + + /// + /// Gets the minimum number of shared directories required to avoid being classified as a leecher. + /// + [Range(1, int.MaxValue)] + public int Directories { get; init; } = 1; + } + /// /// User defined user group options. /// -- cgit v1.2.3