OfdbPlugin implements MovieDatabasePlugin { public String getMovieId(Movie movie) { String ofdbId = movie.getId(OFDB_PLUGIN_ID); if (StringTools.isNotValidString(ofdbId)) { String imdbId = movie.getId(ImdbPlugin.IMDB_PLUGIN_ID); if (StringTools.isValidString(imdbId)) { ofdbId = getOfdbIdByImdbId(imdbId); } if (StringTools.isNotValidString(ofdbId)) { ofdbId = getMovieId(movie.getTitle(), movie.getYear()); } movie.setId(OFDB_PLUGIN_ID, ofdbId); } return ofdbId; } OfdbPlugin(); @Override String getPluginID(); String getMovieId(Movie movie); String getMovieId(String title, String year); @Override boolean scan(Movie movie); @Override boolean scanNFO(String nfo, Movie movie); @Override void scanTVShowTitles(Movie movie); @Override boolean scan(Person person); static final String OFDB_PLUGIN_ID; }
@Test public void testGetMovieId() { LOG.info("GetMovieId"); String id = ofdbPlugin.getMovieId("Avatar", "2009"); assertEquals("http: }