Package net.pms.external.xbmc.info

Examples of net.pms.external.xbmc.info.TitleInfo


  }

  @Override
  public void discoverChildren() {
    XBMCLog.logTimeStart("loading movie info from DB");
    final TitleInfo info = dao.getTitleByID(titleId);
    XBMCLog.logTimeStop();

    if (info == null) {
      addChild(new VirtualFolder("NOT FOUND CHECK LOG", null));
      return;
    }

    if (!info.getFile().exists()) {
      addChild(new VirtualFolder("<FILE IS MISSING>", null));
      return;
    }
    addChild(new VirtualFolder("Title: " + info.getName(), null));

    XBMCLog.logTimeStart("adding title file");
    addChild(new RealFile(info.getFile()) {
      @Override
      public String getName() {
        return "Play";
      }

      @Override
      public void startPlaying(String rendererId) {
        super.startPlaying(rendererId);
        info.setWatched(info.getWatched() + 1);
        dao.updateWatched(info);
      }
    });
    XBMCLog.logTimeStop();

   
    if (info.getTagline() != null && info.getTagline().length() > 0) {
      addChild(new VirtualFolder("Tagline: " + info.getTagline(), null));
    }
    if (info.getRunningTime() != null && info.getRunningTime().length() > 0) {
      addChild(new VirtualFolder("Running Time: " + info.getRunningTime() + "min", null));
    }
    if (info.getAge() != null && info.getAge().length() > 0) {
      addChild(new VirtualFolder("Age: " + info.getAge(), null));
    }
    if (info.getGenre() != null && info.getGenre().length() > 0) {
      addChild(new VirtualFolder("Genre: " + info.getGenre(), null));
    }
    if (info.getSinopsis() != null && info.getSinopsis().length() > 0) {
      addChild(new VirtualFolder("Sinopsis: " + info.getSinopsis(), null));
    }
    if (info.getDirector() != null && info.getDirector().length() > 0) {
      addChild(new VirtualFolder("Director: " + info.getDirector(), null));
    }
    if (info.getWriter() != null && info.getWriter().length() > 0) {
      addChild(new VirtualFolder("Writer: " + info.getWriter(), null));
    }
    if (info.getRating() != null && info.getRating().length() > 0) {
      addChild(new VirtualFolder("IMDB Rating: " + info.getRating(), null));
    }
    if (info.getCountry() != null && info.getCountry().length() > 0) {
      addChild(new VirtualFolder("Country: " + info.getCountry(), null));
    }
    if (info.getStudio() != null && info.getStudio().length() > 0) {
      addChild(new VirtualFolder("Studio: " + info.getStudio(), null));
    }
    if (info.getVideoCodec() != null && info.getVideoCodec().length() > 0) {
      addChild(new VirtualFolder("Video CODEC: " + info.getVideoCodec(), null));
    }
    if (info.getVideoRes() != null && info.getVideoRes().length() > 0) {
      addChild(new VirtualFolder("Video Size: " + info.getVideoRes(), null));
    }
    if (info.getAudioCodec() != null && info.getAudioCodec().length() > 0) {
      addChild(new VirtualFolder("Audio CODEC: " + info.getAudioCodec(), null));
    }
    if (info.getAudioChannels() != null && info.getAudioChannels().length() > 0) {
      addChild(new VirtualFolder("Audio Channels: " + info.getAudioChannels(), null));
    }
    if (info.getEpisode() != null && info.getEpisode().length() > 0) {
      addChild(new VirtualFolder("Season/Episode: " + info.getEpisode(), null));
    }
    addChild(new VirtualFolder("Watched: ", info.getWatched() + " times") {
      @Override
      public String getName() {
        return "Watched: " + info.getWatched() + " times";
      }
    });
    addChild(new VirtualVideoAction("Reset watched count: ", true) {
      @Override
      public boolean enable() {
        info.setWatched(0);
        dao.updateWatched(info);
        XBMCLog.info("watched reset");
        return true;
      }
    });

    addThumbnails(info.getPosters(), Consts.POSTER);
    addThumbnails(info.getFanart(), Consts.FANART);
   
  }
View Full Code Here


    try {
      String stStr = "select * from episodeview where idEpisode = ?";
      st = getConnection().prepareStatement(stStr);
      st.setInt(1, episodeId);
      rs = st.executeQuery();
      TitleInfo mi = null;
      if (rs.next()) {
        mi = new TitleInfo();
        mi.setPosters(getPosterURLs(episodeId));
        mi.setFanart(getFanartURLs(episodeId));
        mi.setActors(getActors(episodeId));
        mi.setTitleId(episodeId);
        mi.setFileId(rs.getInt("idFile"));
        mi.setFile(new File(rs.getString("strPath") + rs.getString("strFileName")));
        mi.setSinopsis(rs.getString("c01"));
        mi.setName(rs.getString("c00"));
        mi.setDirector(rs.getString("c06"));
        mi.setGenre(rs.getString("c14"));
        mi.setAge(rs.getString("c12"));
        mi.setRunningTime(rs.getString("c11"));
        mi.setTagline(rs.getString("c03"));
        mi.setRating(rs.getString("c05"));
        mi.setWatched(rs.getInt("playCount"));
        mi.setEpisode(rs.getString("c12") + "x" + rs.getString("c13"));
      }
      return mi;
    } catch (SQLException e) {
      XBMCLog.error(e);
      return null;
View Full Code Here

    try {
      String stStr = "select *, movieview.idFile fi from movieview left join streamdetails on streamdetails.idFile = movieview.idFile where movieview.idMovie = ?";
      st = getConnection().prepareStatement(stStr);
      st.setInt(1, titleId);
      rs = st.executeQuery();
      TitleInfo mi = null;
      while (rs.next()) {
        if (mi == null) {
          mi = new TitleInfo();

        }
        if (rs.getInt("iStreamType") == 0) { // video stream
          mi.setTitleId(titleId);
          mi.setFileId(rs.getInt("fi"));
          mi.setFile(new File(rs.getString("strPath") + rs.getString("strFileName")));
          mi.setSinopsis(rs.getString("c01"));
          mi.setName(rs.getString("c00"));
          mi.setDirector(rs.getString("c15"));
          mi.setWriter(rs.getString("c06"));
          mi.setGenre(rs.getString("c14"));
          mi.setAge(rs.getString("c12"));
          mi.setRunningTime(rs.getString("c11"));
          mi.setTagline(rs.getString("c03"));
          mi.setRating(rs.getString("c05"));
          mi.setWatched(rs.getInt("playCount"));
          mi.setCountry(rs.getString("c21"));
          mi.setStudio(rs.getString("c18"));
          mi.setVideoCodec(rs.getString("strVideoCodec"));
          mi.setVideoRes(rs.getString("iVideoWidth") + "x" + rs.getString("iVideoHeight"));
        } else { // audio stream
          mi.setAudioCodec(rs.getString("strAudioCodec"));
          mi.setAudioChannels(rs.getString("iAudioChannels"));
        }
      }
      disconnect(st, rs);
      mi.setPosters(getPosterURLs(titleId));
      mi.setFanart(getFanartURLs(titleId));
      mi.setActors(getActors(titleId));
      return mi;
    } catch (SQLException e) {
      XBMCLog.error(e);
      return null;
    } finally {
View Full Code Here

TOP

Related Classes of net.pms.external.xbmc.info.TitleInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.