Beispiel #1
0
 public boolean episodeSetStatus(String tvdbid, List<SeasonEpisodePair> episodes, Status status)
     throws Exception {
   StringBuilder builder = new StringBuilder();
   builder.append("episode.setstatus_0");
   for (int i = 1; i < episodes.size(); i++) {
     builder.append("|episode.setstatus_");
     builder.append(i);
   }
   builder.append("&tvdbid=");
   builder.append(tvdbid);
   builder.append("&status=");
   builder.append(status.toJson());
   for (int i = 0; i < episodes.size(); i++) {
     SeasonEpisodePair p = episodes.get(i);
     builder.append("&episode.setstatus_");
     builder.append(i);
     builder.append(".season=");
     builder.append(p.season);
     builder.append("&episode.setstatus_");
     builder.append(i);
     builder.append(".episode=");
     builder.append(p.episode);
   }
   return this.<Object>commandSuccessful(
       builder.toString(), new TypeToken<JsonResponse<Object>>() {}.getType());
 }
Beispiel #2
0
  public List<Season> showSeasons(String tvdbid) throws Exception {
    StringBuilder builder = new StringBuilder("show.seasons");
    builder.append("&tvdbid=");
    builder.append(tvdbid);

    SeasonsListJson result =
        this.<SeasonsListJson>commandData(
            builder.toString(), new TypeToken<JsonResponse<SeasonsListJson>>() {}.getType());
    List<Season> ret = new ArrayList<Season>();
    for (Map.Entry<String, SeasonsJson> entry : result.entrySet()) {
      ret.add(new Season(entry.getKey(), entry.getValue()));
    }
    return ret;
  }