From d7d4b34c8aa560c847c9e4c4a14de65a8826b923 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 19 Sep 2021 12:38:28 -0500 Subject: consolidate some interfaces and classes --- src/slskd/Application/SharedFileCache.cs | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/slskd/Application/SharedFileCache.cs') diff --git a/src/slskd/Application/SharedFileCache.cs b/src/slskd/Application/SharedFileCache.cs index e1f3e96d..71d1bae1 100644 --- a/src/slskd/Application/SharedFileCache.cs +++ b/src/slskd/Application/SharedFileCache.cs @@ -32,6 +32,51 @@ namespace slskd using Serilog; using Soulseek; + /// + /// Shared file cache. + /// + public interface ISharedFileCache + { + /// + /// Gets the cache state monitor. + /// + IStateMonitor StateMonitor { get; } + + /// + /// Returns the contents of the cache. + /// + /// The contents of the cache. + IEnumerable Browse(); + + /// + /// Scans the configured shares and fills the cache. + /// + /// The operation context. + Task FillAsync(); + + /// + /// Returns the contents of the specified . + /// + /// The directory for which the contents are to be listed. + /// The contents of the directory. + Directory List(string directory); + + /// + /// Substitutes the mask in the specified with the original path, if the mask is tracked + /// by the cache. + /// + /// The fully qualified filename to unmask. + /// The unmasked filename. + public string Resolve(string filename); + + /// + /// Searches the cache for the specified and returns the matching files. + /// + /// The query for which to search. + /// The matching files. + Task> SearchAsync(SearchQuery query); + } + /// /// Shared file cache. /// -- cgit v1.2.3