瀏覽代碼

Merge pull request #11227 from nextcloud/chore/skip-file-exists-check

Skip check for existing files when reading file data from local DB
Álvaro Brey 2 年之前
父節點
當前提交
998862e136
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      app/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java

+ 4 - 1
app/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java

@@ -882,7 +882,10 @@ public class FileDataStorageManager {
         ocFile.setParentId(nullToZero(fileEntity.getParent()));
         ocFile.setMimeType(fileEntity.getContentType());
         ocFile.setStoragePath(fileEntity.getStoragePath());
-        if (ocFile.getStoragePath() == null) {
+        if (ocFile.getStoragePath() == null && ocFile.isFolder()) {
+            // Apparently storagePath is filled only for regular files - even in the current (Jan 2022) implementation.
+            // Check below is still required for directories.
+            //
             // try to find existing file and bind it with current account;
             // with the current update of SynchronizeFolderOperation, this won't be
             // necessary anymore after a full synchronization of the account