From 09ed8c2a18a67981c832a7c26cab24e461a91bbd Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 22 Jul 2012 10:28:32 +0000 Subject: [PATCH] * make it easy to get rotten tomatoes info if necessary --- source/net/sourceforge/filebot/web/IMDbClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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"))) {