From 41897719b57ac3b64a1a9f2f78982e6c9b6dc868 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 30 May 2022 16:11:06 -0500 Subject: split/finalize IShareService --- src/slskd/Shares/IShareService.cs | 77 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/slskd/Shares/IShareService.cs (limited to 'src') diff --git a/src/slskd/Shares/IShareService.cs b/src/slskd/Shares/IShareService.cs new file mode 100644 index 00000000..cc91ba07 --- /dev/null +++ b/src/slskd/Shares/IShareService.cs @@ -0,0 +1,77 @@ +// +// 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/. +// + +namespace slskd.Shares +{ + using System.Collections.Generic; + using System.Threading.Tasks; + using Soulseek; + + /// + /// Provides control and interactions with configured shares and shared files. + /// + public interface IShareService + { + /// + /// Gets the list of configured shares. + /// + IReadOnlyList Shares { get; } + + /// + /// Gets the state monitor for the service. + /// + public IStateMonitor StateMonitor { get; } + + /// + /// Returns the entire contents of the share. + /// + /// The entire contents of the share. + Task> BrowseAsync(); + + /// + /// Returns the contents of the specified . + /// + /// The directory for which the contents are to be listed. + /// The contents of the directory. + Task ListAsync(string directory); + + /// + /// Resolves the local filename of the specified , if the mask is associated with a + /// configured share. + /// + /// The fully qualified filename to resolve. + /// The resolved local filename. + /// + /// Thrown when the specified remote filename can not be associated with a configured share. + /// + Task ResolveAsync(string remoteFilename); + + /// + /// Searches the cache for the specified and returns the matching files. + /// + /// The query for which to search. + /// The matching files. + Task> SearchAsync(SearchQuery query); + + /// + /// Starts a scan of the configured shares. + /// + /// The operation context. + /// Thrown when a scan is already in progress. + Task StartScanAsync(); + } +} -- cgit v1.2.3