aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-05-25 23:29:11 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-05-25 23:29:11 -0500
commit7473491617e71a9e33cde36c5b9d49c77fabc973 (patch)
treefcfeb491ff5f71748a010eb5de128dcc30417833 /src
parentc04b3aa5243213161ed20a9d65b434de37fdab4e (diff)
downloadslskd-7473491617e71a9e33cde36c5b9d49c77fabc973.tar.gz
stub ShareService
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Shares/ShareService.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/slskd/Shares/ShareService.cs b/src/slskd/Shares/ShareService.cs
new file mode 100644
index 00000000..2e4e7c95
--- /dev/null
+++ b/src/slskd/Shares/ShareService.cs
@@ -0,0 +1,27 @@
+namespace slskd.Shares
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ public interface IShareService
+ {
+ ISharedFileCache Cache { get; }
+ IReadOnlyList<Share> List(Func<Share, bool> expression = null);
+ }
+
+ public class ShareService : IShareService
+ {
+ public ShareService(ISharedFileCache sharedFileCache)
+ {
+ Cache = sharedFileCache;
+ }
+
+ public ISharedFileCache Cache { get; }
+
+ public IReadOnlyList<Share> List(Func<Share, bool> expression = null)
+ {
+ return Cache.Shares.Where(expression).ToList().AsReadOnly();
+ }
+ }
+} \ No newline at end of file