aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Shares/ISharedFileCache.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-10-01 17:35:11 -0500
committerGitHub <noreply@github.com>2022-10-01 17:35:11 -0500
commit00f2bfe1b1a0ab8a1162f6c17bc8b98f81dfedd2 (patch)
tree0348bef8843ff8d843f57841ce0c064d0e804658 /src/slskd/Shares/ISharedFileCache.cs
parent92d48858aa02f4900b7fe695f2c23fa3e86c8d74 (diff)
parent0da5a0155e3396f108a4a43e7670cba3fffc523a (diff)
downloadslskd-00f2bfe1b1a0ab8a1162f6c17bc8b98f81dfedd2.tar.gz
Merge pull request #669 from slskd/share-refactor
Refactor share logic
Diffstat (limited to 'src/slskd/Shares/ISharedFileCache.cs')
-rw-r--r--src/slskd/Shares/ISharedFileCache.cs98
1 files changed, 0 insertions, 98 deletions
diff --git a/src/slskd/Shares/ISharedFileCache.cs b/src/slskd/Shares/ISharedFileCache.cs
deleted file mode 100644
index c59f5bba..00000000
--- a/src/slskd/Shares/ISharedFileCache.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-// <copyright file="ISharedFileCache.cs" company="slskd Team">
-// Copyright (c) slskd Team. All rights reserved.
-//
-// This program is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Affero General Public License as published
-// by the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Affero General Public License for more details.
-//
-// You should have received a copy of the GNU Affero General Public License
-// along with this program. If not, see https://www.gnu.org/licenses/.
-// </copyright>
-
-namespace slskd.Shares
-{
- using System.Collections.Generic;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- using Soulseek;
-
- /// <summary>
- /// Shared file cache.
- /// </summary>
- public interface ISharedFileCache
- {
- /// <summary>
- /// Gets the cache state monitor.
- /// </summary>
- IStateMonitor<SharedFileCacheState> StateMonitor { get; }
-
- /// <summary>
- /// Returns the contents of the cache.
- /// </summary>
- /// <param name="share">The optional share to which to limit the scope of the browse.</param>
- /// <returns>The contents of the cache.</returns>
- IEnumerable<Directory> Browse(Share share = null);
-
- /// <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>
- /// <param name="filters">The list of regular expressions used to exclude files or paths from scanning.</param>
- /// <returns>The operation context.</returns>
- Task FillAsync(IEnumerable<Share> shares, IEnumerable<Regex> filters);
-
- /// <summary>
- /// Returns the contents of the specified <paramref name="directory"/>.
- /// </summary>
- /// <param name="directory">The directory for which the contents are to be listed.</param>
- /// <returns>The contents of the directory.</returns>
- Directory List(string directory);
-
- /// <summary>
- /// Substitutes the mask in the specified <paramref name="filename"/> with the original path, if the mask is tracked
- /// by the cache.
- /// </summary>
- /// <param name="filename">The fully qualified filename to unmask.</param>
- /// <returns>The unmasked filename.</returns>
- string Resolve(string filename);
-
- /// <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>
- IEnumerable<File> Search(SearchQuery query);
-
- /// <summary>
- /// Cancels the currently running fill operation, if one is running.
- /// </summary>
- /// <returns>A value indicating whether a fill operation was cancelled.</returns>
- bool TryCancelFill();
-
- /// <summary>
- /// Attempts to load the cache from disk.
- /// </summary>
- /// <returns>A value indicating whether the load was successful.</returns>
- bool TryLoad();
- }
-} \ No newline at end of file