diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index 81d41106..d34b584a 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -860,6 +860,7 @@ public class CmdlineOperations implements CmdlineInterface { return probableMatches; } + @SuppressWarnings("unchecked") public List selectSearchResult(String query, Collection searchResults, boolean strict) throws Exception { List probableMatches = findProbableMatches(query, searchResults, strict); @@ -871,13 +872,10 @@ public class CmdlineOperations implements CmdlineInterface { if (strict) { throw new Exception("Multiple options: Force auto-select requires non-strict matching: " + searchResults); - } else { - if (searchResults.size() > 5) { - throw new Exception("Unable to auto-select search result: " + searchResults); - } else { - return new ArrayList(searchResults); - } } + + // just pick the best 5 matches + probableMatches = (List) sortBySimilarity(searchResults, singleton(query), getSeriesMatchMetric(), false); } // return first and only value