aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Shares/ShareService.cs
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-09-30 17:58:17 -0500
committerJP Dillingham <jp@dillingham.me>2022-09-30 17:58:17 -0500
commit51baabd760922d3cc2f75a327d442b8ac95e780b (patch)
tree1ca2997be14a25093bf7ee5629bab267a30afa52 /src/slskd/Shares/ShareService.cs
parent0727a46658b6de94edcedbb1e496b08d2737ca31 (diff)
downloadslskd-51baabd760922d3cc2f75a327d442b8ac95e780b.tar.gz
clean up a bit
Diffstat (limited to 'src/slskd/Shares/ShareService.cs')
-rw-r--r--src/slskd/Shares/ShareService.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/slskd/Shares/ShareService.cs b/src/slskd/Shares/ShareService.cs
index e11e59e9..ff40481e 100644
--- a/src/slskd/Shares/ShareService.cs
+++ b/src/slskd/Shares/ShareService.cs
@@ -174,7 +174,7 @@ namespace slskd.Shares
/// </exception>
public Task<FileInfo> ResolveFileAsync(string remoteFilename)
{
- var resolvedFilename = Repository.FindOriginalFilename(remoteFilename.LocalizePath());
+ var resolvedFilename = Repository.FindFilename(remoteFilename.LocalizePath());
if (string.IsNullOrEmpty(resolvedFilename))
{
@@ -252,12 +252,12 @@ namespace slskd.Shares
try
{
// see if we need to 'restore' the database from disk, and do so
- if (CacheStorageMode == StorageMode.Memory || (CacheStorageMode == StorageMode.Disk && !Repository.TryValidateTables(Program.ConnectionStrings.Shares)))
+ if (CacheStorageMode == StorageMode.Memory || (CacheStorageMode == StorageMode.Disk && !ShareRepository.TryValidateDatabase(Program.ConnectionStrings.Shares)))
{
Log.Debug($"Share cache {(CacheStorageMode == StorageMode.Memory ? "StorageMode is 'Memory'" : "database is missing from disk")}. Attempting to load from backup...");
// the backup is missing; we can't do anything but recreate it from scratch
- if (!Repository.TryValidateTables(Program.ConnectionStrings.SharesBackup))
+ if (!ShareRepository.TryValidateDatabase(Program.ConnectionStrings.SharesBackup))
{
Log.Debug("Share cache backup is missing; unable to restore");
return false;
@@ -265,7 +265,7 @@ namespace slskd.Shares
Log.Debug("Share cache backup located. Attempting to restore...");
- Repository.Restore(sourceConnectionString: Program.ConnectionStrings.SharesBackup);
+ Repository.RestoreFrom(connectionString: Program.ConnectionStrings.SharesBackup);
Log.Debug("Share cache successfully restored from backup");
}