aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2024-04-20 17:48:15 -0500
committerJP Dillingham <jp@dillingham.me>2024-04-20 17:48:15 -0500
commitb760b7ba6f9200b3f7295c19230b19041d10be21 (patch)
treeb47406ce93978ac2f25cddcf95a816f1084032b4 /src
parente228e3717eddf1168657437187fb1c41ebf1c197 (diff)
downloadslskd-b760b7ba6f9200b3f7295c19230b19041d10be21.tar.gz
expose total count
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Core/Blacklist.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/slskd/Core/Blacklist.cs b/src/slskd/Core/Blacklist.cs
index 3d9805d0..9f49c022 100644
--- a/src/slskd/Core/Blacklist.cs
+++ b/src/slskd/Core/Blacklist.cs
@@ -79,6 +79,11 @@ public enum BlacklistFormat
/// </summary>
public class Blacklist
{
+ /// <summary>
+ /// Gets the total number of loaded CIDRs.
+ /// </summary>
+ public long Count => Cache.Sum(kvp => kvp.Value.Length);
+
private ILogger Log { get; set; } = Serilog.Log.ForContext<Blacklist>();
private ConcurrentDictionary<int, (uint First, uint Last)[]> Cache { get; set; } = new();