diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-03-02 21:40:24 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-02 21:40:24 -0600 |
| commit | 6ef002ac938be75bff76ad3bb2fbfee8133aad7d (patch) | |
| tree | cd9a0628696e6b29cffb9ee694580e375fb21498 /src/slskd/Options.cs | |
| parent | 539d44d4e3812d8ec7b969cc59c1634f00b147f4 (diff) | |
| parent | 244747ab85bf80424c4d376401a8f56db8536a24 (diff) | |
| download | slskd-6ef002ac938be75bff76ad3bb2fbfee8133aad7d.tar.gz | |
Merge pull request #375 from slskd/leechers
Identify leechers
Diffstat (limited to 'src/slskd/Options.cs')
| -rw-r--r-- | src/slskd/Options.cs | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index 5bebeb68..64ca494f 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. /// </remarks> [Validate] - public BuiltInOptions Leechers { get; init; } = new BuiltInOptions(); + public LeecherOptions Leechers { get; init; } = new LeecherOptions(); /// <summary> /// Gets user defined groups and options. @@ -514,6 +514,42 @@ namespace slskd } /// <summary> + /// Built in leecher group options. + /// </summary> + public class LeecherOptions + { + /// <summary> + /// Gets leecher threshold options. + /// </summary> + [Validate] + public ThresholdOptions Thresholds { get; init; } = new ThresholdOptions(); + + /// <summary> + /// Gets upload options. + /// </summary> + [Validate] + public UploadOptions Upload { get; init; } = new UploadOptions(); + } + + /// <summary> + /// Leecher threshold options. + /// </summary> + public class ThresholdOptions + { + /// <summary> + /// Gets the minimum number of shared files required to avoid being classified as a leecher. + /// </summary> + [Range(1, int.MaxValue)] + public int Files { get; init; } = 1; + + /// <summary> + /// Gets the minimum number of shared directories required to avoid being classified as a leecher. + /// </summary> + [Range(1, int.MaxValue)] + public int Directories { get; init; } = 1; + } + + /// <summary> /// User defined user group options. /// </summary> public class UserDefinedOptions |
