diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-10-10 17:30:39 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-10-10 17:30:39 -0500 |
| commit | a0476551cf8da20cbc51361d20a28a3b12bd4395 (patch) | |
| tree | 1eda106a12bf0027929111b12f66600bbd7ebdef /src | |
| parent | 345485ad861ad0b2e643a3dbfc21eac013cd755c (diff) | |
| download | slskd-a0476551cf8da20cbc51361d20a28a3b12bd4395.tar.gz | |
add BackupTo()
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> |
