diff --git a/src/main/java/com/owncloud/android/ui/activity/FolderSyncActivity.java b/src/main/java/com/owncloud/android/ui/activity/FolderSyncActivity.java index d5a233ff81..1f8adef766 100644 --- a/src/main/java/com/owncloud/android/ui/activity/FolderSyncActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/FolderSyncActivity.java @@ -234,10 +234,14 @@ public class FolderSyncActivity extends FileActivity implements FolderSyncAdapte List result = new ArrayList<>(); for (MediaFolder mediaFolder : mediaFolders) { - if (syncedFoldersMap.containsKey(mediaFolder.absolutePath)) { - SyncedFolder syncedFolder = syncedFoldersMap.get(mediaFolder.absolutePath); + if (syncedFoldersMap.containsKey(mediaFolder.absolutePath+"-"+mediaFolder.type)) { + SyncedFolder syncedFolder = syncedFoldersMap.get(mediaFolder.absolutePath+"-"+mediaFolder.type); syncedFoldersMap.remove(mediaFolder.absolutePath); - result.add(createSyncedFolder(syncedFolder, mediaFolder)); + if (MediaFolder.CUSTOM == syncedFolder.getType()) { + result.add(createSyncedFolderWithoutMediaFolder(syncedFolder)); + } else { + result.add(createSyncedFolder(syncedFolder, mediaFolder)); + } } else { result.add(createSyncedFolderFromMediaFolder(mediaFolder)); } @@ -245,8 +249,7 @@ public class FolderSyncActivity extends FileActivity implements FolderSyncAdapte // No media folder and thus always a custom folder for (SyncedFolder syncedFolder : syncedFoldersMap.values()) { - SyncedFolderDisplayItem syncedFolderDisplayItem = createSyncedFolderWithoutMediaFolder(syncedFolder); - result.add(syncedFolderDisplayItem); + result.add(createSyncedFolderWithoutMediaFolder(syncedFolder)); } return result; @@ -405,7 +408,7 @@ public class FolderSyncActivity extends FileActivity implements FolderSyncAdapte Map result = new HashMap<>(); if (syncFolders != null) { for (SyncedFolder syncFolder : syncFolders) { - result.put(syncFolder.getLocalPath(), syncFolder); + result.put(syncFolder.getLocalPath()+"-"+syncFolder.getType(), syncFolder); } } return result;