mirror of
https://github.com/mitb-archive/filebot
synced 2024-08-13 17:03:45 -04:00
* allow Windows case-change only if filename differs
This commit is contained in:
parent
68df1b7c09
commit
3c1306ec2c
@ -303,7 +303,8 @@ class RenameAction extends AbstractAction {
|
||||
// rename file, throw exception on failure
|
||||
File source = mapping.getKey();
|
||||
File destination = resolveDestination(mapping.getKey(), mapping.getValue(), false);
|
||||
if (!source.getAbsolutePath().equals(destination.getAbsolutePath())) {
|
||||
boolean isSameFile = source.equals(destination);
|
||||
if (!isSameFile || (isSameFile && !source.getName().equals(destination.getName()))) {
|
||||
action.rename(source, destination);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ public final class FileUtilities {
|
||||
} else {
|
||||
// on Windows ATOMIC_MOVE allows us to rename files even if only lower/upper-case changes (without ATOMIC_MOVE the operation would be ignored)
|
||||
try {
|
||||
java.nio.file.Files.move(source.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE);
|
||||
java.nio.file.Files.move(source.toPath(), destination.toPath(), StandardCopyOption.ATOMIC_MOVE);
|
||||
} catch (AtomicMoveNotSupportedException e) {
|
||||
java.nio.file.Files.move(source.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user