本文整理汇总了Java中com.omertron.themoviedbapi.MovieDbException类的典型用法代码示例。如果您正苦于以下问题:Java MovieDbException类的具体用法?Java MovieDbException怎么用?Java MovieDbException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MovieDbException类属于com.omertron.themoviedbapi包,在下文中一共展示了MovieDbException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMovie
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public static Movie getMovie(MovieInfo movieInfo, Torrent torrent) {
Movie movie = torrent != null ? torrent.getMovie() : null;
if (movie == null) {
movie = new Movie();
if (torrent != null) {
torrent.setMovie(movie);
}
}
movie.setTitle(movieInfo.getTitle());
movie.setOriginalTitle(movieInfo.getOriginalTitle());
if (StringUtils.isNotBlank(movieInfo.getOverview())) {
movie.setPlot(movieInfo.getOverview());
}
try {
Configuration configuration = instance.getConfiguration();
String posterPath = configuration.createImageUrl(movieInfo.getPosterPath(), configuration.getPosterSizes().get(0)).toExternalForm();
if (StringUtils.isNotBlank(posterPath)) {
movie.setPoster(posterPath);
}
} catch (MovieDbException e) {
e.printStackTrace();
}
return movie;
}
示例2: MovieDbPosterPlugin
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public MovieDbPosterPlugin() {
super();
// Check to see if we are needed
if (!isNeeded()) {
return;
}
languageCode = PropertiesUtil.getProperty("themoviedb.language", "en");
if (languageCode.length() > 2) {
languageCode = languageCode.substring(0, 2).toLowerCase();
}
LOG.debug("Using '{}' as the language code", languageCode);
try {
tmdb = new TheMovieDbApi(apiKey, YamjHttpClientBuilder.getHttpClient());
} catch (MovieDbException ex) {
LOG.warn("Failed to initialise TheMovieDB API.");
LOG.warn(SystemTools.getStackTrace(ex));
}
}
示例3: getPosterUrl
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
@Override
public IImage getPosterUrl(String id) {
URL posterURL;
if (StringUtils.isNumeric(id)) {
try {
MovieInfo moviedb = tmdb.getMovieInfo(Integer.parseInt(id), languageCode);
LOG.debug("Movie found on TheMovieDB.org: http://www.themoviedb.org/movie/{}", id);
posterURL = tmdb.createImageUrl(moviedb.getPosterPath(), DEFAULT_POSTER_SIZE);
return new Image(posterURL.toString());
} catch (MovieDbException ex) {
LOG.warn("Failed to get the poster URL for TMDB ID {} {}", id, ex.getMessage());
}
}
return Image.UNKNOWN;
}
示例4: init
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public void init() throws ServletException {
InitializeWCR initWcr = new InitializeWCR();
BackgroundTopology t = new BackgroundTopology();
// boolean isFakeTopologyForTest = false;
boolean isFakeTopologyForTest = true;
try {
initWcr.getWiseCrowdRecConfigInfo();
initWcr.twitterInitBack();
initWcr.cassandraInitial();
initWcr.coreNLPInitial();
initWcr.themoviedbOrgInitial();
initWcr.rabbitmqInit();
t.startTopology(isFakeTopologyForTest, "wcr_topology_back", "I rated #IMDb");
} catch ( NoSuchFieldException | IllegalAccessException | InstantiationException
| ClassNotFoundException | URISyntaxException | IOException | TException | MovieDbException e) {
e.printStackTrace();
}
}
示例5: getPeople
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public List<Person> getPeople(List<Integer> peopleList) throws MovieDbException, IOException {
if (!isInit) init();
List<Person> returnList = new ArrayList<Person>();
System.out.println("Obtaining Person data from TMDB...");
for (Integer personId : peopleList) {
com.omertron.themoviedbapi.model.Person tmdbPerson = api.getPersonInfo(personId);
Person p = new Person();
p.setId(tmdbPerson.getId());
p.setName(tmdbPerson.getName());
p.setBirthYear(Strings.isNullOrEmpty(tmdbPerson.getBirthday()) ? 1900 : Integer.parseInt(tmdbPerson.getBirthday().substring(0, 4)));
p.setPopularity(tmdbPerson.getPopularity());
p.setImgPath(tmdbPerson.getProfilePath());
p.setImdbId(tmdbPerson.getImdbId());
// /* get list of movieIds for which the person was part of the CAST */
// TmdbResultsList<PersonCredit> tmdbResultsList = api.getPersonCredits(tmdbPerson.getId());
// List<PersonCredit> credits = tmdbResultsList.getResults();
// List<Integer> creditList = new ArrayList<Integer>();
// for (PersonCredit credit : credits) {
// /* if they are cast and don't already have a credit for the same film, add them */
// if (credit.getPersonType().equals(PersonType.CAST) && !creditList.contains(credit.getMovieId())) creditList.add(credit.getMovieId());
// }
// p.setMovies(creditList);
returnList.add(p);
}
System.out.println("Obtaining Person data complete.");
return returnList;
}
示例6: getMovies
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public List<Movie> getMovies(List<Integer> movieIds) throws MovieDbException, IOException {
List<String> strIds = new ArrayList<String>();
for (Integer i : movieIds) {
strIds.add(String.valueOf(i));
}
return getMovies(strIds, false);
}
示例7: getMovieCredits
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public List<Credit> getMovieCredits(Integer movieId) throws MovieDbException {
List<Credit> cast = new ArrayList<Credit>();
TmdbResultsList<com.omertron.themoviedbapi.model.Person> tmdbCast = api.getMovieCasts(movieId);
List<com.omertron.themoviedbapi.model.Person> castList = tmdbCast.getResults();
int index = 1;
for (com.omertron.themoviedbapi.model.Person p : castList) {
if (p.getPersonType().equals(PersonType.CAST) && !cast.contains(p.getId()))
cast.add(new Credit(p.getId(), movieId, index++));
}
return cast;
}
示例8: getFullImageUrl
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public String getFullImageUrl(String posterPath, String size) {
try {
return movieDbApi.createImageUrl(posterPath, size).toString();
} catch (MovieDbException e) {
e.printStackTrace();
}
return "";
}
示例9: getPopularTV
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public ResultList<TVBasic> getPopularTV(int pageNumber) {
try {
return movieDbApi.getTVPopular(pageNumber, null);
} catch (MovieDbException e) {
e.printStackTrace();
}
return new ResultList<>();
}
示例10: searchTV
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public ResultList<TVBasic> searchTV(String title, int pageNumber) {
try {
return movieDbApi.searchTV(title, pageNumber, null, null, null);
} catch (MovieDbException e) {
e.printStackTrace();
}
return new ResultList<>();
}
示例11: getTVInfo
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public TVInfo getTVInfo(int tmdbId, String... appendToResponse) {
try {
return movieDbApi.getTVInfo(tmdbId, null, appendToResponse);
} catch (MovieDbException e) {
e.printStackTrace();
}
return new TVInfo();
}
示例12: getTvSeasonInfo
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public TVSeasonInfo getTvSeasonInfo(int tmdbId, int seasonNumber) {
try {
return movieDbApi.getSeasonInfo(tmdbId, seasonNumber, null);
} catch (MovieDbException e) {
e.printStackTrace();
}
return new TVSeasonInfo();
}
示例13: getPopularMovies
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public ResultList<MovieInfo> getPopularMovies(int pageNumber) {
try {
return movieDbApi.getPopularMovieList(pageNumber, null);
} catch (MovieDbException e) {
e.printStackTrace();
}
return new ResultList<>();
}
示例14: searchMovie
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public ResultList<MovieInfo> searchMovie(String title, int pageNumber) {
try {
return movieDbApi.searchMovie(title, pageNumber, null, true, null, null, null);
} catch (MovieDbException e) {
e.printStackTrace();
}
return new ResultList<>();
}
示例15: getMovieInfo
import com.omertron.themoviedbapi.MovieDbException; //导入依赖的package包/类
public MovieInfo getMovieInfo(int tmdbId, String... appendToResponse) {
try {
return movieDbApi.getMovieInfo(tmdbId, null, appendToResponse);
} catch (MovieDbException e) {
e.printStackTrace();
}
return new MovieInfo();
}