From e012ea79040c3ba2862c178d50d4fab294477c98 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 8 Sep 2022 21:05:01 -0500 Subject: split interface --- src/slskd/Shares/SharedFileCache.cs | 58 ++----------------------------------- 1 file changed, 2 insertions(+), 56 deletions(-) (limited to 'src/slskd/Shares/SharedFileCache.cs') diff --git a/src/slskd/Shares/SharedFileCache.cs b/src/slskd/Shares/SharedFileCache.cs index ed55fe2a..6490478c 100644 --- a/src/slskd/Shares/SharedFileCache.cs +++ b/src/slskd/Shares/SharedFileCache.cs @@ -31,60 +31,6 @@ namespace slskd.Shares 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. - /// - /// Initiates the scan, then yields execution back to the caller; does not wait for the operation to complete. - /// The list of shares from which to fill the cache. - /// The list of regular expressions used to exclude files or paths from scanning. - /// The operation context. - Task FillAsync(IEnumerable shares, IEnumerable filters); - - /// - /// 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. - IEnumerable Search(SearchQuery query); - - /// - /// Attempts to load the cache from disk. - /// - /// A value indicating whether the load was successful. - bool TryLoad(); - } - /// /// Shared file cache. /// @@ -133,7 +79,7 @@ namespace slskd.Shares // in the root. to get around this, prime a dictionary with all known directories, and an empty Soulseek.Directory. if // there are any files in the directory, this entry will be overwritten with a new Soulseek.Directory containing the // files. if not they'll be left as is. - foreach (var directory in ListDirectories()) + foreach (var directory in ListDirectories().OrderBy(d => d)) { directories.TryAdd(directory, new Directory(directory)); } @@ -169,7 +115,7 @@ namespace slskd.Shares f.Size, f.Extension, f.Attributes); - }))); + }).OrderBy(f => f.Filename))); // merge the dictionary containing all directories with the Soulseek.Directory instances containing their files. // entries with no files will remain untouched. -- cgit v1.2.3