当前位置: 首页>>代码示例>>Java>>正文


Java MovieDbException类代码示例

本文整理汇总了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;
   }
 
开发者ID:crsmoro,项目名称:vntscraper,代码行数:25,代码来源:TheMovieDbApi.java

示例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));
    }
}
 
开发者ID:YAMJ,项目名称:yamj-v2,代码行数:23,代码来源:MovieDbPosterPlugin.java

示例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;
}
 
开发者ID:YAMJ,项目名称:yamj-v2,代码行数:17,代码来源:MovieDbPosterPlugin.java

示例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();
  }
}
 
开发者ID:faustineinsun,项目名称:WiseCrowdRec,代码行数:21,代码来源:StartBackgroundTopologyAutomatically.java

示例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;
    }
 
开发者ID:polyrob,项目名称:QuickFlix,代码行数:33,代码来源:TMDBManager.java

示例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);
}
 
开发者ID:polyrob,项目名称:QuickFlix,代码行数:8,代码来源:TMDBManager.java

示例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;
}
 
开发者ID:polyrob,项目名称:QuickFlix,代码行数:14,代码来源:TMDBManager.java

示例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 "";
}
 
开发者ID:priitl,项目名称:p2p-webtv,代码行数:9,代码来源:TmdbService.java

示例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<>();
}
 
开发者ID:priitl,项目名称:p2p-webtv,代码行数:9,代码来源:TmdbService.java

示例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<>();
}
 
开发者ID:priitl,项目名称:p2p-webtv,代码行数:9,代码来源:TmdbService.java

示例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();
}
 
开发者ID:priitl,项目名称:p2p-webtv,代码行数:9,代码来源:TmdbService.java

示例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();
}
 
开发者ID:priitl,项目名称:p2p-webtv,代码行数:9,代码来源:TmdbService.java

示例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<>();
}
 
开发者ID:priitl,项目名称:p2p-webtv,代码行数:9,代码来源:TmdbService.java

示例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<>();
}
 
开发者ID:priitl,项目名称:p2p-webtv,代码行数:9,代码来源:TmdbService.java

示例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();
}
 
开发者ID:priitl,项目名称:p2p-webtv,代码行数:9,代码来源:TmdbService.java


注:本文中的com.omertron.themoviedbapi.MovieDbException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。