diff --git a/source/net/sourceforge/filebot/web/IMDbClient.java b/source/net/sourceforge/filebot/web/IMDbClient.java index 67d5c894..d4f96bc7 100644 --- a/source/net/sourceforge/filebot/web/IMDbClient.java +++ b/source/net/sourceforge/filebot/web/IMDbClient.java @@ -176,9 +176,9 @@ public class IMDbClient implements MovieIdentificationService { @SuppressWarnings({ "unchecked", "rawtypes" }) - public Map getImdbApiData(String i, String t, String y) throws IOException { + public Map getImdbApiData(Integer i, String t, String y, boolean tomatoes) throws IOException { // e.g. http://www.imdbapi.com/?i=tt0379786&r=xml&tomatoes=true - String url = String.format("http://www.imdbapi.com/?i=%s&t=%s&y=%s&r=xml", i, t, y); + String url = String.format("http://www.imdbapi.com/?i=%s&t=%s&y=%s&r=xml&tomatoes=%s", String.format(i == null ? "" : "tt%07d", i), t, y, tomatoes); CachedResource data = new CachedResource(url, HashMap.class, 7 * 24 * 60 * 60 * 1000) { @Override @@ -197,7 +197,7 @@ public class IMDbClient implements MovieIdentificationService { public MovieInfo getImdbApiMovieInfo(Movie movie) throws IOException { - Map data = movie.getImdbId() > 0 ? getImdbApiData(String.format("tt%07d", movie.getImdbId()), "", "") : getImdbApiData("", movie.getName(), String.valueOf(movie.getYear())); + Map data = movie.getImdbId() > 0 ? getImdbApiData(movie.getImdbId(), "", "", false) : getImdbApiData(null, movie.getName(), String.valueOf(movie.getYear()), false); // sanity check if (!Boolean.parseBoolean(data.get("response"))) {