TheTvDBPlugin extends ImdbPlugin { public static Banners getBanners(String id) { Banners banners = (Banners) CacheMemory.getFromCache(CacheMemory.generateCacheKey(CACHE_BANNERS, id, LANGUAGE_PRIMARY)); if (banners == null) { try { banners = TVDB.getBanners(id); CacheMemory.addToCache(CacheMemory.generateCacheKey(CACHE_BANNERS, id, LANGUAGE_PRIMARY), banners); } catch (Exception error) { LOG.warn("Error getting Banners: {}", error.getMessage()); } } return banners; } TheTvDBPlugin(); @Override String getPluginID(); @Override boolean scan(Movie movie); String getBanner(Movie movie); @Override void scanTVShowTitles(Movie movie); @Override boolean scanNFO(String nfo, Movie movie); static Series getSeries(String id); static String findId(Movie movie); static Banners getBanners(String id); static final String THETVDB_PLUGIN_ID; static final String CACHE_SERIES; static final String CACHE_BANNERS; }
@Test public void testGetBanners() { LOG.info("getBanners"); Banners result = TheTvDBPlugin.getBanners(String.valueOf(ID_BABYLON_5)); assertNotNull("Null result", result); assertEquals("Invalid Series ID", ID_BABYLON_5, result.getSeriesId()); assertFalse("No Fanart", result.getFanartList().isEmpty()); assertFalse("No Posters", result.getPosterList().isEmpty()); assertFalse("No Seasons", result.getSeasonList().isEmpty()); assertFalse("No Series", result.getSeriesList().isEmpty()); }