diff --git a/source/net/filebot/cli/CmdlineOperations.java b/source/net/filebot/cli/CmdlineOperations.java index c413bbbc..8b1746fb 100644 --- a/source/net/filebot/cli/CmdlineOperations.java +++ b/source/net/filebot/cli/CmdlineOperations.java @@ -502,7 +502,7 @@ public class CmdlineOperations implements CmdlineInterface { } protected Movie selectMovie(String query, Collection options) throws Exception { - query = query.toLowerCase(); + query = normalizePunctuation(query).toLowerCase(); // auto-select perfect match for (Movie movie : options) { @@ -512,7 +512,8 @@ public class CmdlineOperations implements CmdlineInterface { } } - return selectSearchResult(query, options, false, false, false, 1).stream().findFirst().orElse(null); + List selection = selectSearchResult(query, options, false, false, false, 1); + return selection.isEmpty() ? null : selection.get(0); } public List renameMusic(Collection files, RenameAction renameAction, ConflictAction conflictAction, File outputDir, ExpressionFileFormat format, List services, ExecCommand exec) throws Exception {