diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Shares/IShareService.cs | 8 | ||||
| -rw-r--r-- | src/slskd/Shares/ShareService.cs | 9 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/slskd/Shares/IShareService.cs b/src/slskd/Shares/IShareService.cs index f8e2076d..5144ada8 100644 --- a/src/slskd/Shares/IShareService.cs +++ b/src/slskd/Shares/IShareService.cs @@ -15,8 +15,6 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // </copyright> -using System.IO; - namespace slskd.Shares { using System.Collections.Generic; @@ -39,6 +37,12 @@ namespace slskd.Shares public IStateMonitor<ShareState> StateMonitor { get; } /// <summary> + /// Backs contents of the cache up to the specified file. + /// </summary> + /// <param name="connectionString">The destination connection string.</param> + void BackupTo(string connectionString); + + /// <summary> /// Returns the entire contents of the share. /// </summary> /// <returns>The entire contents of the share.</returns> diff --git a/src/slskd/Shares/ShareService.cs b/src/slskd/Shares/ShareService.cs index 2b761965..23917535 100644 --- a/src/slskd/Shares/ShareService.cs +++ b/src/slskd/Shares/ShareService.cs @@ -99,6 +99,15 @@ namespace slskd.Shares private ILogger Log { get; } = Serilog.Log.ForContext<ShareService>(); /// <summary> + /// Backs contents of the cache up to the specified file. + /// </summary> + /// <param name="connectionString">The destination connection string.</param> + public void BackupTo(string connectionString) + { + Repository.BackupTo(connectionString); + } + + /// <summary> /// Returns the entire contents of the share. /// </summary> /// <returns>The entire contents of the share.</returns> |
