зеркало из https://github.com/nextcloud/desktop.git
Fix recursive directory metadata renaming order
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Родитель
9cc05457c0
Коммит
02e1d6a47f
|
@ -199,6 +199,13 @@ class NextcloudFilesDatabaseManager : NSObject {
|
|||
let metadatasToAdd = Array(metadatasToUpdate.map { NextcloudItemMetadataTable(value: $0) }) +
|
||||
Array(metadatasToCreate.map { NextcloudItemMetadataTable(value: $0) })
|
||||
|
||||
for metadata in directoriesNeedingRename {
|
||||
|
||||
if let updatedDirectoryChildren = renameDirectoryAndPropagateToChildren(ocId: metadata.ocId, newServerUrl: metadata.serverUrl, newFileName: metadata.fileName) {
|
||||
metadatasToUpdate += updatedDirectoryChildren
|
||||
}
|
||||
}
|
||||
|
||||
try database.write {
|
||||
for metadata in metadatasToDelete {
|
||||
// Can't pass copies, we need the originals from the database
|
||||
|
@ -211,12 +218,6 @@ class NextcloudFilesDatabaseManager : NSObject {
|
|||
|
||||
}
|
||||
|
||||
for metadata in directoriesNeedingRename {
|
||||
if let updatedDirectoryChildren = renameDirectoryAndPropagateToChildren(ocId: metadata.ocId, newServerUrl: metadata.serverUrl, newFileName: metadata.fileName) {
|
||||
metadatasToUpdate += updatedDirectoryChildren
|
||||
}
|
||||
}
|
||||
|
||||
return (newMetadatas: metadatasToCreate, updatedMetadatas: metadatasToUpdate, deletedMetadatas: metadatasToDelete)
|
||||
} catch let error {
|
||||
Logger.ncFilesDatabase.error("Could not update any item metadatas, received error: \(error.localizedDescription, privacy: .public)")
|
||||
|
|
Загрузка…
Ссылка в новой задаче