瀏覽代碼

show downloaded encrypted files in subfolders

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 4 年之前
父節點
當前提交
419b14afcf

+ 1 - 1
src/main/java/com/owncloud/android/operations/RefreshFolderOperation.java

@@ -535,7 +535,7 @@ public class RefreshFolderOperation extends RemoteOperation {
                     localFile.getModificationTimestampAtLastSyncForData()
             );
             if (localFile.isEncrypted()) {
-                updatedFile.setStoragePath(mLocalFolder.getRemotePath() + PATH_SEPARATOR + localFile.getFileName());
+                updatedFile.setStoragePath(mLocalFolder.getDecryptedRemotePath() + localFile.getFileName());
             } else {
                 updatedFile.setStoragePath(localFile.getStoragePath());
             }

+ 2 - 2
src/main/java/com/owncloud/android/utils/FileStorageUtils.java

@@ -98,7 +98,7 @@ public final class FileStorageUtils {
      * file.
      */
     public static String getDefaultSavePathFor(String accountName, OCFile file) {
-        return getSavePath(accountName) + file.getDecryptedRemotePath();
+        return getSavePath(accountName) + file.getStoragePath();
     }
 
     /**
@@ -334,7 +334,7 @@ public final class FileStorageUtils {
      * @param account   Account holding file.
      */
     public static void searchForLocalFileInDefaultPath(OCFile file, Account account) {
-        if (file.getStoragePath() == null && !file.isFolder()) {
+        if ((file.getStoragePath() == null || !new File(file.getStoragePath()).exists()) && !file.isFolder()) {
             File f = new File(FileStorageUtils.getDefaultSavePathFor(account.name, file));
             if (f.exists()) {
                 file.setStoragePath(f.getAbsolutePath());