From ef14db36cb3bc20427b39d911af06c9832e6a2af Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 8 May 2016 20:31:06 +0800 Subject: [PATCH] Fix TheTVDB artwork rating issues --- source/net/filebot/web/TheTVDBClient.java | 2 +- test/net/filebot/web/TheTVDBClientTest.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/net/filebot/web/TheTVDBClient.java b/source/net/filebot/web/TheTVDBClient.java index 973b3fe2..1e791a21 100644 --- a/source/net/filebot/web/TheTVDBClient.java +++ b/source/net/filebot/web/TheTVDBClient.java @@ -251,7 +251,7 @@ public class TheTVDBClient extends AbstractEpisodeListProvider implements Artwor String subKey = getString(it, "subKey"); String fileName = getString(it, "fileName"); String resolution = getString(it, "resolution"); - Double rating = getDecimal(getString(it, "ratingsInfo"), "average"); + Double rating = getDecimal(getMap(it, "ratingsInfo"), "average"); return new Artwork(this, Stream.of(category, subKey, resolution), resolveBanner(fileName), locale, rating); } catch (Exception e) { diff --git a/test/net/filebot/web/TheTVDBClientTest.java b/test/net/filebot/web/TheTVDBClientTest.java index 120a8e9d..16e1f75b 100644 --- a/test/net/filebot/web/TheTVDBClientTest.java +++ b/test/net/filebot/web/TheTVDBClientTest.java @@ -140,13 +140,14 @@ public class TheTVDBClientTest { } @Test - public void getImages() throws Exception { + public void getArtwork() throws Exception { Artwork i = thetvdb.getArtwork(buffy.getId(), "fanart", Locale.ENGLISH).get(0); - assertEquals("[fanart, 1280x720]", i.getTags().toString()); - assertEquals("http://thetvdb.com/banners/fanart/original/70327-1.jpg", i.getUrl().toString()); - assertTrue(i.matches("fanart", "1280x720")); - assertFalse(i.matches("fanart", "1280x720", "1")); + assertEquals("[fanart, 1920x1080]", i.getTags().toString()); + assertEquals("http://thetvdb.com/banners/fanart/original/70327-7.jpg", i.getUrl().toString()); + assertTrue(i.matches("fanart", "1920x1080")); + assertFalse(i.matches("fanart", "1920x1080", "1")); + assertEquals(8.0, i.getRating(), 1.0); } }