aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2025-04-07 16:59:00 +0200
committerGitHub <noreply@github.com>2025-04-07 08:59:00 -0600
commit04ca27ad075bdab1eae49c43fde1ed6d45c050e4 (patch)
tree449abee43629682b15d280bb0578db0e397a667b /src
parente1ef4290afd7dddf5fa2f01ef2d6a4093a7898be (diff)
Fix backup not written to correct directory (#13853)
* Fix backup not written to correct directory * Improve restore handling and only restore on actual error * Fix first failed migration not causing a rollback
Diffstat (limited to 'src')
-rw-r--r--src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteDatabaseProvider.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteDatabaseProvider.cs b/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteDatabaseProvider.cs
index e818c3524..bd5631074 100644
--- a/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteDatabaseProvider.cs
+++ b/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/SqliteDatabaseProvider.cs
@@ -98,7 +98,7 @@ public sealed class SqliteDatabaseProvider : IJellyfinDatabaseProvider
Directory.CreateDirectory(backupFile);
}
- backupFile = Path.Combine(_applicationPaths.DataPath, $"{key}_jellyfin.db");
+ backupFile = Path.Combine(backupFile, $"{key}_jellyfin.db");
File.Copy(path, backupFile);
return Task.FromResult(key);
}
@@ -106,6 +106,8 @@ public sealed class SqliteDatabaseProvider : IJellyfinDatabaseProvider
/// <inheritdoc />
public Task RestoreBackupFast(string key, CancellationToken cancellationToken)
{
+ // ensure there are absolutly no dangling Sqlite connections.
+ SqliteConnection.ClearAllPools();
var path = Path.Combine(_applicationPaths.DataPath, "jellyfin.db");
var backupFile = Path.Combine(_applicationPaths.DataPath, BackupFolderName, $"{key}_jellyfin.db");