aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-05-28 23:02:41 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-05-28 23:02:41 -0500
commit79bfb864cd3acaa398cfc32849c455fb5313c3ce (patch)
treeac00725a3087ccaf392ba17e5f6810fe43e6a70e /src/slskd
parente9c1a68650fa3567b04c8543f8cf77926b099a4f (diff)
downloadslskd-79bfb864cd3acaa398cfc32849c455fb5313c3ce.tar.gz
start ShareService refactor
Diffstat (limited to 'src/slskd')
-rw-r--r--src/slskd/Shares/ShareService.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/slskd/Shares/ShareService.cs b/src/slskd/Shares/ShareService.cs
index 2e4e7c95..763bb819 100644
--- a/src/slskd/Shares/ShareService.cs
+++ b/src/slskd/Shares/ShareService.cs
@@ -1,3 +1,5 @@
+using Microsoft.Extensions.Options;
+
namespace slskd.Shares
{
using System;
@@ -12,16 +14,22 @@ namespace slskd.Shares
public class ShareService : IShareService
{
- public ShareService(ISharedFileCache sharedFileCache)
+ public ShareService(
+ ISharedFileCache sharedFileCache,
+ IOptionsMonitor<Options> optionsMonitor)
{
Cache = sharedFileCache;
+ OptionsMonitor = optionsMonitor;
}
public ISharedFileCache Cache { get; }
+ private IOptionsMonitor<Options> OptionsMonitor { get; }
+ private List<Share> Shares { get; set; } = new List<Share>();
+
public IReadOnlyList<Share> List(Func<Share, bool> expression = null)
{
- return Cache.Shares.Where(expression).ToList().AsReadOnly();
+ return Shares.Where(expression).ToList().AsReadOnly();
}
}
} \ No newline at end of file