public void verifyMetadata(IMetadata md) { assertEquals("Iron Man 2", md.getMediaTitle()); assertTrue(md.getActors().size() > 10); boolean foundCast = false; for (ICastMember cm : md.getActors()) { if (cm.getName().equals("Robert Downey Jr.")) { foundCast = true; assertEquals("Robert Downey Jr.", cm.getName()); assertEquals("Tony Stark / Iron Man", cm.getRole()); } } assertTrue("No cast found", foundCast); assertNotNull(md.getDescription()); assertTrue(md.getDescription().length() > 50); assertTrue(md.getDirectors().size() > 0); assertEquals("Iron Man 2", md.getEpisodeName()); assertTrue(md.getGenres().size() > 0); assertEquals("Adventure", md.getGenres().get(0)); assertEquals("tt1228705", md.getIMDBID()); assertEquals("10138", md.getMediaProviderDataID()); assertEquals("tmdb3", md.getMediaProviderID()); assertEquals("Iron Man 2", md.getMediaTitle()); assertEquals(MediaType.MOVIE.sageValue(), md.getMediaType()); assertEquals(DateUtils.parseDate("2010-05-07").getTime(), md.getOriginalAirDate().getTime()); assertEquals("PG-13", md.getRated()); // no extended ratings // assertTrue(md.getExtendedRatings().length()>4); assertEquals(MetadataSearchUtil.convertTimeToMillissecondsForSage("124"), md.getRunningTime()); assertEquals("Iron Man 2", md.getEpisodeName()); assertNull(md.getRelativePathWithTitle()); assertTrue("Invalid User Rating: " + md.getUserRating(), md.getUserRating() > 0); assertTrue(md.getDirectors().size() > 0); assertTrue(md.getWriters().size() > 0); assertTrue(md.getProducers().size() > 0); assertEquals(2010, md.getYear()); assertTrue(md.getTagLine().length() > 0); assertTrue(md.getTrailerUrl().length() > 0); assertTrue(md.getTrailerUrl().contains("www.youtube.com")); TMDB3Configuration config = GroupProxy.get(TMDB3Configuration.class); assertEquals(count(md.getFanart(), MediaArtifactType.POSTER), config.getMaxPosters()); assertEquals(count(md.getFanart(), MediaArtifactType.BACKGROUND), config.getMaxBackgrounds()); for (IMediaArt ma : md.getFanart()) { assertTrue(ma.getDownloadUrl().startsWith("http")); } // assertTrue(md.getQuotes().length()>0); // assertTrue(md.getTrivia().length()>0); }
public PhoenixFanartSupport() { fanartConfig = GroupProxy.get(MetadataConfiguration.class); initializeFanartFolder(fanartConfig.getFanartCentralFolder()); }