Ejemplo n.º 1
0
  public String getMovieInfo(MediaFile mf) {

    String year = getMovieYear(mf.getName());
    DataObject info;
    TitleSearchOptions options;
    DataService service = new ImdbDataService(new ImdbServer(), new DataObjectConverterImpl());
    if (year != null) {
      options = new TitleSearchOptions(mf.getMediaName(), year);
    } else {
      options = new TitleSearchOptions(mf.getName());
    }
    //        options.setPlot("simple");
    info = service.getDataByTitle("http://imdbapi.org", options);
    if (info == null || info.getError() != null) {
      return "No Infromation Found for item [" + mf.getMediaName() + "] ";
    }
    return parseMovieInfo(info);
  }
Ejemplo n.º 2
0
  private String parseMovieInfo(DataObject info) {
    String str = "\n**************   *I**N**F**O*   *****************\n\n";
    str += "\n Name: " + info.getTitle() + " [" + info.getYear() + "]";
    str +=
        "\n Duration: "
            + info.getRuntime()
            + " Rating: ["
            + info.getImdb_user_rating()
            + "/10] from "
            + info.getImdb_votes_count()
            + " users";
    str += "\n Language: " + info.getLanguage() + " Type: " + info.getType();
    str += "\n Genres: " + info.getGenres();
    str += "\n Plot: " + parseMoviePlot(info.getStoryLine());
    str += "\n Directors: " + info.getDirectors();
    str += "\n Actores: " + trimMovieActors(info.getCast(), 5);
    str += "\n \n \n**************   ******   **********************";

    return str;
  }