1
0
mirror of https://github.com/mitb-archive/filebot synced 2025-03-10 06:20:27 -04:00

default behavior if rename map is empty

This commit is contained in:
Reinhard Pointner 2016-11-25 08:03:59 +08:00
parent 0a14298e8d
commit d03794600b

View File

@ -64,6 +64,11 @@ public class CmdlineOperationsTextUI extends CmdlineOperations {
@Override @Override
public List<File> renameAll(Map<File, File> renameMap, RenameAction renameAction, ConflictAction conflictAction, List<Match<File, ?>> matches) throws Exception { public List<File> renameAll(Map<File, File> renameMap, RenameAction renameAction, ConflictAction conflictAction, List<Match<File, ?>> 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 // manually confirm each file mapping
Map<File, File> selection = onScreen(() -> confirmRenameMap(renameMap, renameAction, conflictAction)); Map<File, File> selection = onScreen(() -> confirmRenameMap(renameMap, renameAction, conflictAction));
@ -74,12 +79,11 @@ public class CmdlineOperationsTextUI extends CmdlineOperations {
protected List<SearchResult> selectSearchResult(String query, Collection<? extends SearchResult> options, boolean alias, boolean strict) throws Exception { protected List<SearchResult> selectSearchResult(String query, Collection<? extends SearchResult> options, boolean alias, boolean strict) throws Exception {
List<SearchResult> matches = getProbableMatches(query, options, alias, false); List<SearchResult> matches = getProbableMatches(query, options, alias, false);
// manually select option if there is more than one if (matches.size() < 2) {
if (matches.size() > 1) { return matches;
return onScreen(() -> confirmSearchResult(query, matches));
} }
return matches; return onScreen(() -> confirmSearchResult(query, matches)); // manually select option if there is more than one
} }
protected List<SearchResult> confirmSearchResult(String query, List<SearchResult> options) { protected List<SearchResult> confirmSearchResult(String query, List<SearchResult> options) {