diff --git a/lib/data/file_manager/file_manager.dart b/lib/data/file_manager/file_manager.dart index 1da8f1886..ca43559c1 100644 --- a/lib/data/file_manager/file_manager.dart +++ b/lib/data/file_manager/file_manager.dart @@ -166,7 +166,13 @@ class FileManager { } else { assert(filePath.startsWith('/'), 'Expected filePath to start with a slash, got $filePath'); - return File(documentsDirectory + filePath); + if (filePath.startsWith(documentsDirectory)) { + // already contains document directory path + return File(filePath); + } + else { + return File(documentsDirectory + filePath); + } } } diff --git a/lib/data/nextcloud/saber_syncer.dart b/lib/data/nextcloud/saber_syncer.dart index aa359d66a..a5a81459c 100644 --- a/lib/data/nextcloud/saber_syncer.dart +++ b/lib/data/nextcloud/saber_syncer.dart @@ -78,10 +78,10 @@ class SaberSyncInterface final bestFile = await getBestFile(syncFile); switch (bestFile) { case BestFile.local: - case BestFile.either: // Local file is newer, do nothing break; case BestFile.remote: + case BestFile.either: //local file does not exists changedFiles.add(syncFile); } }