Ejemplo n.º 1
0
  /**
   * Parameter with a search-query for a specific movie, Returns Full information about the Movie+ a
   * Trailer. First->Clean the query, and then get the data from APIConnector and return it as
   * String (Already converted to JSON.
   *
   * @param query -search query
   * @return String
   */
  public String info(String query) {
    /*//Fetch Trailer
    Movie movieTemp;
    movieTemp = gson.fromJson(controller.trailer(movie.getimdbID()), Movie.class);
    //Return as JSON
    movie.setTrailer(movieTemp.getTrailer());
    return gson.toJson(movie);
     *
     */

    Movie movie = apiC.getInfo(qc.info(query));
    Movie movieTemp;
    movieTemp = gson.fromJson(trailerByImdb(movie.getimdbID()), Movie.class);
    if (movieTemp == null) {
      movieTemp = gson.fromJson(trailerByTitle(movie.getTitle()), Movie.class);
    }

    if (movieTemp != null) {
      movie.setTrailer(movieTemp.getTrailer());
    }

    return gson.toJson(movie);

    // return apiC.getInfo(qc.info(query));
  }
Ejemplo n.º 2
0
  public String searchInfo(String query) {

    Movie movie = apiC.getInfo(qc.info(query));

    return gson.toJson(movie);
  }