FanartTvPlugin { public FTSeries getTvArtwork(int tvdbId) { String key = CacheMemory.generateCacheKey(FANARTTV_PLUGIN_ID, String.valueOf(tvdbId)); FTSeries ftArtwork = (FTSeries) CacheMemory.getFromCache(key); if (ftArtwork == null || ftArtwork.hasArtwork()) { try { ftArtwork = ft.getTvArtwork(Integer.toString(tvdbId)); if (ftArtwork != null && ftArtwork.hasArtwork()) { CacheMemory.addToCache(key, ftArtwork); } return ftArtwork; } catch (FanartTvException ex) { LOG.warn("Failed to get fanart information for TVDB ID: {}. Error: {}", tvdbId, ex.getMessage(), ex); return new FTSeries(); } } return ftArtwork; } FanartTvPlugin(); boolean scan(Movie movie); boolean scan(Movie movie, final FTArtworkType artworkType); FTSeries getTvArtwork(int tvdbId); FTMovie getMovieArtwork(int tmdbId, String imdbId); static boolean isArtworkRequired(FTArtworkType requiredType); static boolean isArtworkRequired(String artworkType); static final String FANARTTV_PLUGIN_ID; }
@Test public void testGetTvArtwork() { LOG.info("getTvArtwork"); int tvdbId = 79216; FTSeries result = ft.getTvArtwork(tvdbId); assertEquals("Wrong results found", "The IT Crowd", result.getName()); }