From e4e2c2e3366b9aa80ab95f0060ddae4168dc7407 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Thu, 7 Aug 2014 21:33:08 +0000 Subject: [PATCH] * improved support for non-English movie titles in English-mode --- source/net/filebot/web/TMDbClient.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/source/net/filebot/web/TMDbClient.java b/source/net/filebot/web/TMDbClient.java index 967b2901..04427151 100644 --- a/source/net/filebot/web/TMDbClient.java +++ b/source/net/filebot/web/TMDbClient.java @@ -118,12 +118,9 @@ public class TMDbClient implements MovieIdentificationService { } try { - String countryCode = locale.getCountry().isEmpty() ? "US" : locale.getCountry(); JSONObject titles = request("movie/" + id + "/alternative_titles", null, null, REQUEST_LIMIT); for (JSONObject node : jsonList(titles.get("titles"))) { - if (countryCode.equals(node.get("iso_3166_1"))) { - alternativeTitles.add((String) node.get("title")); - } + alternativeTitles.add((String) node.get("title")); } } catch (Exception e) { Logger.getLogger(TMDbClient.class.getName()).log(Level.WARNING, String.format("Unable to retrieve alternative titles [%s]: %s", title, e.getMessage())); @@ -222,14 +219,12 @@ public class TMDbClient implements MovieIdentificationService { } List alternativeTitles = new ArrayList(); - String countryCode = locale.getCountry().isEmpty() ? "US" : locale.getCountry(); JSONObject titles = (JSONObject) response.get("alternative_titles"); for (JSONObject it : jsonList(titles.get("titles"))) { - if (countryCode.equals(it.get("iso_3166_1"))) { - alternativeTitles.add((String) it.get("title")); - } + alternativeTitles.add((String) it.get("title")); } + String countryCode = locale.getCountry().isEmpty() ? "US" : locale.getCountry(); JSONObject releases = (JSONObject) response.get("releases"); for (JSONObject it : jsonList(releases.get("countries"))) { if (countryCode.equals(it.get("iso_3166_1"))) {