diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-08-05 09:46:33 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-05 09:46:33 -0500 |
| commit | adca7674d78c73ef2f2bd505bd4652460794826c (patch) | |
| tree | e1a8812a3797b36846b5e00c53e478b938989dc2 /src/slskd/Application/ISharedFileCache.cs | |
| parent | fdded3572f465c2ddc3110c0927711537215fd58 (diff) | |
| parent | d33a280c2307925aa68102beaa2e61a38f8e7e6c (diff) | |
| download | slskd-adca7674d78c73ef2f2bd505bd4652460794826c.tar.gz | |
Merge pull request #140 from slskd/share-hash
Make shared file cache fill asynchronous, enable re-scanning shares at runtime via API
Diffstat (limited to 'src/slskd/Application/ISharedFileCache.cs')
| -rw-r--r-- | src/slskd/Application/ISharedFileCache.cs | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/slskd/Application/ISharedFileCache.cs b/src/slskd/Application/ISharedFileCache.cs index 97133e40..291d78e4 100644 --- a/src/slskd/Application/ISharedFileCache.cs +++ b/src/slskd/Application/ISharedFileCache.cs @@ -17,20 +17,37 @@ namespace slskd { - using System; using System.Collections.Generic; + using System.Threading.Tasks; using Soulseek; + /// <summary> + /// Shared file cache. + /// </summary> public interface ISharedFileCache { - event EventHandler<(int Directories, int Files)> Refreshed; + /// <summary> + /// Gets the cache state. + /// </summary> + IStateMonitor<SharedFileCacheState> State { get; } - IEnumerable<string> Directories { get; } - DateTime? LastFill { get; } - long TTL { get; } + /// <summary> + /// Returns the contents of the cache. + /// </summary> + /// <returns>The contents of the cache.</returns> + IEnumerable<Directory> Browse(); - void Fill(); + /// <summary> + /// Scans the configured shares and fills the cache. + /// </summary> + /// <returns>The operation context.</returns> + Task FillAsync(); - IEnumerable<File> Search(SearchQuery query); + /// <summary> + /// Searches the cache for the specified <paramref name="query"/> and returns the matching files. + /// </summary> + /// <param name="query">The query for which to search.</param> + /// <returns>The matching files.</returns> + Task<IEnumerable<File>> SearchAsync(SearchQuery query); } }
\ No newline at end of file |
