fix: move() only rename if relocationResult has different name than target
This commit is contained in:
parent
46dbde1103
commit
615fe5558e
@ -214,12 +214,15 @@ class PCloudImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (source instanceof PCloudFolder) {
|
if (source instanceof PCloudFolder) {
|
||||||
//TODO: check if this can be reached at all
|
|
||||||
relocationResult = client().moveFolder(source.getId(), target.getParent().getId()).execute();
|
relocationResult = client().moveFolder(source.getId(), target.getParent().getId()).execute();
|
||||||
relocationResult = client().renameFolder(relocationResult.asFolder(), target.getName()).execute();
|
if (!relocationResult.name().equals(target.getName())) {
|
||||||
|
relocationResult = client().renameFolder(relocationResult.asFolder(), target.getName()).execute();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
relocationResult = client().moveFile(source.getId(), target.getParent().getId()).execute().asFile();
|
relocationResult = client().moveFile(source.getId(), target.getParent().getId()).execute();
|
||||||
relocationResult = client().renameFile(relocationResult.asFile(), target.getName()).execute();
|
if (!relocationResult.name().equals(target.getName())) {
|
||||||
|
relocationResult = client().renameFile(relocationResult.asFile(), target.getName()).execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
idCache.remove(source);
|
idCache.remove(source);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user