diff --git a/source/net/filebot/ui/rename/RenameAction.java b/source/net/filebot/ui/rename/RenameAction.java index 133089de..f7fce6de 100644 --- a/source/net/filebot/ui/rename/RenameAction.java +++ b/source/net/filebot/ui/rename/RenameAction.java @@ -324,7 +324,7 @@ class RenameAction extends AbstractAction { File source = mapping.getKey(); File destination = resolve(mapping.getKey(), mapping.getValue()); - if (!source.equals(destination) || (source.equals(destination) && !source.getName().equals(destination.getName()))) { + if (!equalsCaseSensitive(source, destination)) { action.rename(source, destination); } diff --git a/source/net/filebot/util/FileUtilities.java b/source/net/filebot/util/FileUtilities.java index c45c9020..de4605e2 100644 --- a/source/net/filebot/util/FileUtilities.java +++ b/source/net/filebot/util/FileUtilities.java @@ -72,7 +72,7 @@ public final class FileUtilities { // on Windows, use ATOMIC_MOVE which allows us to rename files even if only lower/upper-case changes (without ATOMIC_MOVE the operation would be ignored) // but ATOMIC_MOVE can only work for files on the same drive, if that is not the case there is no point trying move with ATOMIC_MOVE - if (isWindows() && source.equals(destination)) { + if (source.equals(destination)) { try { return Files.move(source.toPath(), destination.toPath(), StandardCopyOption.ATOMIC_MOVE).toFile(); } catch (AtomicMoveNotSupportedException e) { @@ -246,10 +246,6 @@ public final class FileUtilities { return UTF_8.decode(data).toString(); } - public static boolean isWindows() { - return '\\' == File.separatorChar; - } - public static boolean equalsCaseSensitive(File a, File b) { return a.getPath().equals(b.getPath()); }