SubBabaPosterPlugin extends AbstractMoviePosterPlugin implements ITvShowPosterPlugin { @Override public IImage getPosterUrl(String id) { LOG.debug("Searching for poster URL with ID: {}", id); if (StringTools.isNotValidString(id)) { return Image.UNKNOWN; } IImage posterImage = getFirstContent(id, SearchType.POSTERS); if (posterImage.equals(Image.UNKNOWN)) { posterImage = getFirstContent(id, SearchType.DVD_COVERS); if (!posterImage.equals(Image.UNKNOWN)) { LOG.debug("Found DVD Cover for ID {}, cropping image to poster size.", id); posterImage.setSubimage("0, 0, 47, 100"); } } if (!posterImage.equals(Image.UNKNOWN)) { LOG.debug("Found poster URL: {}", posterImage.getUrl()); } return posterImage; } SubBabaPosterPlugin(); @Override String getIdFromMovieInfo(String title, String year); @Override IImage getPosterUrl(String id); @Override IImage getPosterUrl(String title, String year); @Override String getIdFromMovieInfo(String title, String year, int tvSeason); @Override IImage getPosterUrl(String title, String year, int tvSeason); @Override IImage getPosterUrl(String id, int season); @Override String getName();  }
@Test public void testGetPosterUrl() { IImage posterImage = posterPlugin.getPosterUrl(AVATAR.imdbId); assertEquals("http: assertEquals(Movie.UNKNOWN, posterImage.getSubimage()); }
@Test public void testGetPosterUrlWithSubimage() { IImage posterImage = posterPlugin.getPosterUrl(GLADIATOR.imdbId); assertEquals("http: assertEquals("0, 0, 47, 100", posterImage.getSubimage()); }