Neeraj Gupta 2 anos atrás
pai
commit
a018d33478

+ 3 - 2
lib/db/device_files_db.dart

@@ -156,8 +156,9 @@ extension DeviceFiles on FilesDB {
         }
       }
       // add the mappings for localIDs
-      debugPrint("Insert pathToLocalIDs mapping while importing localAssets");
-      await insertPathIDToLocalIDMapping(pathIDToLocalIDsMap);
+      if (pathIDToLocalIDsMap.isNotEmpty) {
+        await insertPathIDToLocalIDMapping(pathIDToLocalIDsMap);
+      }
     } catch (e) {
       _logger.severe("failed to save path names", e);
       rethrow;

+ 1 - 1
lib/services/local_sync_service.dart

@@ -288,7 +288,7 @@ class LocalSyncService {
     );
     final Tuple2<List<LocalPathAsset>, List<File>> result =
         await getLocalPathAssetsAndFiles(fromTime, toTime, _computer);
-    FilesDB.instance.insertLocalAssets(
+    await FilesDB.instance.insertLocalAssets(
       result.item1,
       shouldAutoBackup: Configuration.instance.hasSelectedAllFoldersForBackup(),
     );