fix(database): swallow legacy documents lookup failures

This commit is contained in:
edde746
2026-06-13 13:25:34 +02:00
parent 49ae1fdc34
commit f3f962a7c9
2 changed files with 32 additions and 6 deletions
+11 -6
View File
@@ -663,13 +663,18 @@ Future<void> migrateLegacyDesktopDatabase({
Future<void> Function(File source, String targetPath)? renameOverride,
}) async {
final File oldFile;
if (sourceOverride != null) {
oldFile = sourceOverride;
} else {
final oldFolder = await getApplicationDocumentsDirectory();
oldFile = File(p.join(oldFolder.path, 'plezy_downloads.db'));
try {
if (sourceOverride != null) {
oldFile = sourceOverride;
} else {
final oldFolder = await getApplicationDocumentsDirectory();
oldFile = File(p.join(oldFolder.path, 'plezy_downloads.db'));
}
if (!await oldFile.exists()) return;
} catch (e, st) {
appLogger.w('Legacy DB migration skipped before source lookup completed', error: e, stackTrace: st);
return;
}
if (!await oldFile.exists()) return;
try {
if (renameOverride != null) {