1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-05 00:45:06 -05:00

* only search by movie name if the potential query has at least 3 characters

This commit is contained in:
Reinhard Pointner 2014-05-13 12:42:20 +00:00
parent 0797ee7111
commit 5830025d60

View File

@ -78,6 +78,11 @@ public class TMDbClient implements MovieIdentificationService {
// use y:2014 year filter if possible
String query = (movieYear > 0) ? String.format("%s y:%d", movieName, movieYear) : movieName.toString();
// ignore queries that are too short to yield good results
if (movieName.length() < 3) {
return emptyList();
}
JSONObject response = request("search/movie", singletonMap("query", query), locale, SEARCH_LIMIT);
List<Movie> result = new ArrayList<Movie>();