Package net.sourceforge.seriesdownloader.model

Examples of net.sourceforge.seriesdownloader.model.Episode


    int editId = Util.parseInt(params.get("edit"), -1);
    if (editId != -1) {
      Show show = WatchListController.findShowByTVRageId(editId);
      if (!Util.isEmpty(params.get("episode"))) {
        String episode = params.get("episode");
        show.setNextEpisode(new Episode(episode, "Unknown"));
        show.setNextAirDate(null);
        new ShowInfoFinder(show).start();
      }
      return true;
    }
View Full Code Here


        case 2:
          changed.setNextAirDate(Util.parseDate(value));
          break;
        case 3:
          changed.setNextAirDate(null);
          changed.setNextEpisode(new Episode((String) value, null));
          break;
      }
      new ShowInfoFinder(changed).start();

      if (column != 0)
View Full Code Here

   
    List<Element> nodes = doc.selectNodes("//Season[@no='"+show.getNextEpisode().getSeason()+"']/episode[seasonnum="+show.getNextEpisode().getEpisode()+"]");
    if (nodes.size() == 0) return;
    Element node = nodes.get(0);
   
    show.setNextEpisode(new Episode(show.getNextEpisode().toString(), node.elementText("title")));
   
    Calendar cal = Calendar.getInstance();
    cal.setTime(dateFormat.parse(node.elementText("airdate")));
    cal.add(Calendar.DAY_OF_MONTH, 1);
    show.setNextAirDate(cal.getTime());
View Full Code Here

  private void tickShow() throws DocumentException {
    String source = "";
    try {
      source = WGet.getSource(tvrageEplistUrl + show.getTvrageId());
    } catch (Exception e) {
      Episode ep = show.getNextEpisode();
      ep.setEpisode(ep.getEpisode()+1);
      return;
    }
    Document doc = DocumentHelper.parseText(source);

    List<Element> nodes = doc.selectNodes("//episode");
    boolean next = false;
    for (Element episode : nodes) {
      if (next) {
        show.setNextEpisode(
            new Episode(
            Util.parseInt(episode.getParent().attributeValue("no"), -1)
            , Util.parseInt(episode.elementText("seasonnum"), -1)));
        new EpInfoSearcher(show).start();
        return;
      }

      next = Util.parseInt(episode.getParent().attributeValue("no"), -1) == show.getNextEpisode().getSeason()
          && Util.parseInt(episode.elementText("seasonnum"), -1) == show.getNextEpisode().getEpisode();
    }
    show.setNextEpisode(new Episode(show.getNextEpisode().getSeason(), show.getNextEpisode().getEpisode() + 1, "Unknown"));
    show.setNextAirDate(null);
    WatchListController.showInfoCompleted(show);
  }
View Full Code Here

    String latestEpisode = infoMap.get("Latest Episode");
    String nextEpisode = infoMap.get("Next Episode");
    String status = infoMap.get("Status");

    if (nextEpisode == null && status != null && status.contains("Ended")) {
      show.setNextEpisode(new Episode(0, 0, "Show ended / cancelled"));
      show.setNextAirDate(null);
    } else if (nextEpisode == null && latestEpisode != null) {
      Episode latestPlus1 = getEpisodeFromInfo(latestEpisode);
      latestPlus1.setEpisode(latestPlus1.getEpisode() + 1);
      latestPlus1.setName("Not yet scheduled / season ended");
      show.setNextEpisode(latestPlus1);
      show.setNextAirDate(null);
    } else if (nextEpisode != null) {
      show.setNextEpisode(getEpisodeFromInfo(nextEpisode));
      show.setNextAirDate(getDateFromInfo(nextEpisode));
View Full Code Here

  private Episode getEpisodeFromInfo(String info) {
    String[] infoArr = info.split("\\^");
    if (infoArr.length < 2)
      return null;
    return new Episode(infoArr[0], infoArr[1]);
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.seriesdownloader.model.Episode

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.