aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Shares/ShareService.cs6
-rw-r--r--src/slskd/Shares/SharedFileCache.cs36
2 files changed, 4 insertions, 38 deletions
diff --git a/src/slskd/Shares/ShareService.cs b/src/slskd/Shares/ShareService.cs
index e159237d..e99d048a 100644
--- a/src/slskd/Shares/ShareService.cs
+++ b/src/slskd/Shares/ShareService.cs
@@ -220,8 +220,10 @@ namespace slskd.Shares
/// <returns>The summary information.</returns>
public Task<(int Directories, int Files)> SummarizeShareAsync(Share share)
{
- var dirs = Cache.CountDirectories(share);
- var files = Cache.CountFiles(share);
+ var prefix = share.RemotePath + Path.DirectorySeparatorChar;
+
+ var dirs = Repository.CountDirectories(prefix);
+ var files = Repository.CountFiles(prefix);
return Task.FromResult((dirs, files));
}
diff --git a/src/slskd/Shares/SharedFileCache.cs b/src/slskd/Shares/SharedFileCache.cs
index 3ff3d10f..190679a8 100644
--- a/src/slskd/Shares/SharedFileCache.cs
+++ b/src/slskd/Shares/SharedFileCache.cs
@@ -43,20 +43,6 @@ namespace slskd.Shares
IStateMonitor<SharedFileCacheState> StateMonitor { get; }
/// <summary>
- /// Returns the number of directories in the specified <paramref name="share"/>.
- /// </summary>
- /// <param name="share">The share for which the directories are to be counted.</param>
- /// <returns>The number of directories.</returns>
- int CountDirectories(Share share);
-
- /// <summary>
- /// Returns the number of files in the specified <paramref name="share"/>.
- /// </summary>
- /// <param name="share">The share for which the files are to be counted.</param>
- /// <returns>The number of files.</returns>
- int CountFiles(Share share);
-
- /// <summary>
/// Scans the configured shares and fills the cache.
/// </summary>
/// <param name="shares">The list of shares from which to fill the cache.</param>
@@ -134,28 +120,6 @@ namespace slskd.Shares
private IShareRepository Repository { get; }
/// <summary>
- /// Returns the number of directories in the specified <paramref name="share"/>.
- /// </summary>
- /// <param name="share">The share for which the directories are to be counted.</param>
- /// <returns>The number of directories.</returns>
- public int CountDirectories(Share share)
- {
- var path = share.RemotePath + Path.DirectorySeparatorChar;
- return Repository.CountDirectories(path);
- }
-
- /// <summary>
- /// Returns the number of files in the specified <paramref name="share"/>.
- /// </summary>
- /// <param name="share">The share for which the files are to be counted.</param>
- /// <returns>The number of files.</returns>
- public int CountFiles(Share share)
- {
- var path = share.RemotePath + Path.DirectorySeparatorChar;
- return Repository.CountFiles(path);
- }
-
- /// <summary>
/// Scans the configured shares and fills the cache.
/// </summary>
/// <param name="shares">The list of shares from which to fill the cache.</param>