diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2022-05-28 23:02:41 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2022-05-28 23:02:41 -0500 |
| commit | 79bfb864cd3acaa398cfc32849c455fb5313c3ce (patch) | |
| tree | ac00725a3087ccaf392ba17e5f6810fe43e6a70e | |
| parent | e9c1a68650fa3567b04c8543f8cf77926b099a4f (diff) | |
| download | slskd-79bfb864cd3acaa398cfc32849c455fb5313c3ce.tar.gz | |
start ShareService refactor
| -rw-r--r-- | src/slskd/Shares/ShareService.cs | 12 |
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 |
