diff --git a/source/net/filebot/web/TMDbClient.java b/source/net/filebot/web/TMDbClient.java index 48cb526d..d408ac1b 100644 --- a/source/net/filebot/web/TMDbClient.java +++ b/source/net/filebot/web/TMDbClient.java @@ -173,8 +173,17 @@ public class TMDbClient implements MovieIdentificationService, ArtworkProvider { public MovieInfo getMovieInfo(String id, Locale locale, boolean extendedInfo) throws Exception { Object response = request("movie/" + id, extendedInfo ? singletonMap("append_to_response", "alternative_titles,releases,casts,trailers") : emptyMap(), locale, REQUEST_LIMIT); + // read all basic movie properties Map fields = getEnumMap(response, MovieProperty.class); + // fix poster path + try { + fields.computeIfPresent(MovieProperty.poster_path, (k, v) -> resolveImage(v).toString()); + } catch (Exception e) { + // movie does not belong to any collection + debug.warning(format("Bad data: poster_path => %s", response)); + } + try { Map collection = getMap(response, "belongs_to_collection"); fields.put(MovieProperty.collection, getString(collection, "name")); @@ -510,6 +519,10 @@ public class TMDbClient implements MovieIdentificationService, ArtworkProvider { return get(MovieProperty.homepage, URL::new); } + public URL getPoster() { + return get(MovieProperty.poster_path, URL::new); + } + public List getGenres() { return unmodifiableList(asList(genres)); }