Support --conflict override for disk folders

@see https://www.filebot.net/forums/viewtopic.php?f=8&t=4863&p=27193#p27190
This commit is contained in:
Reinhard Pointner 2017-03-25 01:30:01 +08:00
parent 1a91e379a0
commit ff2617e6e4
1 changed files with 7 additions and 4 deletions

View File

@ -597,10 +597,13 @@ public class CmdlineOperations implements CmdlineInterface {
if (conflictAction == ConflictAction.OVERRIDE || (conflictAction == ConflictAction.AUTO && VideoQuality.isBetter(source, destination))) { if (conflictAction == ConflictAction.OVERRIDE || (conflictAction == ConflictAction.AUTO && VideoQuality.isBetter(source, destination))) {
// do not delete files in test mode // do not delete files in test mode
if (renameAction.canRevert() && destination.delete()) { if (renameAction.canRevert()) {
log.info(format("[%s] Delete [%s]", conflictAction, destination)); try {
} else { log.info(format("[%s] Delete [%s]", conflictAction, destination));
log.warning(format("[%s] Unable to delete [%s]", conflictAction, destination)); delete(destination);
} catch (Exception e) {
log.warning(format("[%s] Failed to delete [%s]: %s", conflictAction, destination, e));
}
} }
} else if (conflictAction == ConflictAction.INDEX) { } else if (conflictAction == ConflictAction.INDEX) {
destination = nextAvailableIndexedName(destination); destination = nextAvailableIndexedName(destination);