aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Shares/IShareService.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-09-25 14:36:31 -0500
committerGitHub <noreply@github.com>2022-09-25 14:36:31 -0500
commitcabbd9c2fcb30c6194d25045dd4a9f4bdf6d6e4f (patch)
tree883663596f57ac644c8e23a520fea8219588a060 /src/slskd/Shares/IShareService.cs
parent67bc4bed7726204bd373bd8e784dbb819cc2dadd (diff)
parentb6eebb3f6695c93bce44ceb17725b7342085ae16 (diff)
downloadslskd-cabbd9c2fcb30c6194d25045dd4a9f4bdf6d6e4f.tar.gz
Merge pull request #656 from slskd/cancel-scan
Add the ability to cancel a share scan
Diffstat (limited to 'src/slskd/Shares/IShareService.cs')
-rw-r--r--src/slskd/Shares/IShareService.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/slskd/Shares/IShareService.cs b/src/slskd/Shares/IShareService.cs
index 962d4c1e..73f6a4ad 100644
--- a/src/slskd/Shares/IShareService.cs
+++ b/src/slskd/Shares/IShareService.cs
@@ -42,7 +42,7 @@ namespace slskd.Shares
/// Returns the entire contents of the share.
/// </summary>
/// <returns>The entire contents of the share.</returns>
- Task<IEnumerable<Directory>> BrowseAsync();
+ Task<IEnumerable<Directory>> BrowseAsync(Share share = null);
/// <summary>
/// Returns the contents of the specified <paramref name="directory"/>.
@@ -70,11 +70,24 @@ namespace slskd.Shares
Task<IEnumerable<File>> SearchAsync(SearchQuery query);
/// <summary>
- /// Starts a scan of the configured shares.
+ /// Scans the configured shares.
/// </summary>
/// <returns>The operation context.</returns>
/// <exception cref="ShareScanInProgressException">Thrown when a scan is already in progress.</exception>
- Task StartScanAsync();
+ Task ScanAsync();
+
+ /// <summary>
+ /// Gets summary information for the specified <paramref name="share"/>.
+ /// </summary>
+ /// <param name="share">The share to summarize.</param>
+ /// <returns>The summary information.</returns>
+ Task<(int Directories, int Files)> SummarizeShareAsync(Share share);
+
+ /// <summary>
+ /// Cancels the currently running scan, if one is running.
+ /// </summary>
+ /// <returns>A value indicating whether a scan was cancelled.</returns>
+ bool TryCancelScan();
/// <summary>
/// Attempt to load shares from disk.