1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

* don't allow file override so people can't mess up their stuff, but allow when src/dest path is the same, i.e. doesn't need any change, for usability reasons

This commit is contained in:
Reinhard Pointner 2013-04-13 06:14:38 +00:00
parent 41264f0045
commit fc8f6bc7ef

View File

@ -171,6 +171,9 @@ class RenameAction extends AbstractAction {
if (destinationSet.contains(destination))
throw new IllegalArgumentException("Conflict detected: " + mapping.getValue().getPath());
if (destination.exists() && !resolveDestination(mapping.getKey(), mapping.getValue(), false).equals(mapping.getKey()))
throw new IllegalArgumentException("File already exists: " + mapping.getValue().getPath());
// use original mapping values
renameMap.put(mapping.getKey(), mapping.getValue());
destinationSet.add(destination);