From d03794600bb678d119de0eeae88338d264534b35 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 25 Nov 2016 08:03:59 +0800 Subject: [PATCH] default behavior if rename map is empty --- source/net/filebot/cli/CmdlineOperationsTextUI.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/net/filebot/cli/CmdlineOperationsTextUI.java b/source/net/filebot/cli/CmdlineOperationsTextUI.java index 082ac616..0d7f99ed 100644 --- a/source/net/filebot/cli/CmdlineOperationsTextUI.java +++ b/source/net/filebot/cli/CmdlineOperationsTextUI.java @@ -64,6 +64,11 @@ public class CmdlineOperationsTextUI extends CmdlineOperations { @Override public List renameAll(Map renameMap, RenameAction renameAction, ConflictAction conflictAction, List> matches) throws Exception { + // default behavior if rename map is empty + if (renameMap.isEmpty()) { + return super.renameAll(renameMap, renameAction, conflictAction, matches); + } + // manually confirm each file mapping Map selection = onScreen(() -> confirmRenameMap(renameMap, renameAction, conflictAction)); @@ -74,12 +79,11 @@ public class CmdlineOperationsTextUI extends CmdlineOperations { protected List selectSearchResult(String query, Collection options, boolean alias, boolean strict) throws Exception { List matches = getProbableMatches(query, options, alias, false); - // manually select option if there is more than one - if (matches.size() > 1) { - return onScreen(() -> confirmSearchResult(query, matches)); + if (matches.size() < 2) { + return matches; } - return matches; + return onScreen(() -> confirmSearchResult(query, matches)); // manually select option if there is more than one } protected List confirmSearchResult(String query, List options) {