diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2022-05-25 23:29:11 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2022-05-25 23:29:11 -0500 |
| commit | 7473491617e71a9e33cde36c5b9d49c77fabc973 (patch) | |
| tree | fcfeb491ff5f71748a010eb5de128dcc30417833 /src | |
| parent | c04b3aa5243213161ed20a9d65b434de37fdab4e (diff) | |
| download | slskd-7473491617e71a9e33cde36c5b9d49c77fabc973.tar.gz | |
stub ShareService
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Shares/ShareService.cs | 27 |
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 |
