Show rssShow = rssShows.get(i);
Show show = getShow(rssShow.getTitle());
if(show!=null) {
for(Season rssSeason : rssShow.seasons) {
int seasonInt = rssSeason.getNumber();
Season season = show.findSeason(seasonInt);
if(show.getCurSeason()<=seasonInt) {
if(show.getCurSeason()<seasonInt) {
season = show.addSeason(seasonInt);
show.setLastEpisode(0);
LOGGER.info("Found new season (" + seasonInt + ") of " + show.getTitle());
show.setCurSeason(seasonInt);
}
for(Episode rssEpisode : rssSeason.getEpisodes()) {
int episodeInt = rssEpisode.getNumber();
Episode episode = null;
if(season!=null) {
episode = season.findEpisode(episodeInt);
}
if(show.getLastEpisode()<episodeInt && episode==null) {
if(season==null) {
season = show.addSeason(seasonInt);
}
for(int m=show.getLastEpisode()+1;m<episodeInt;m++) {
LOGGER.info("Found new episode (" + m + ") of " + show.getTitle() + " in season " + seasonInt);
season.addEpisode(m, " ", " ");
pendingNotice(show.getTitle() + " (" + seasonInt + "x" + m + ") is now available.");
}
LOGGER.info("Found new episode (" + episodeInt + ") of " + show.getTitle() + " in season " + seasonInt);
season.addEpisode(episodeInt, rssEpisode.getLink(), rssEpisode.getLinkLabel());
pendingNotice(show.getTitle() + " (" + seasonInt + "x" + episodeInt + ") is now available.");
show.setLastEpisode(episodeInt);
}
if(episode!=null) {
int newPriority = Settings.getInstance().getFeedPriority(rssEpisode.getLinkLabel());