mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-20 15:55:25 +03:00
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
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user