def POST(self, id): form = self.form() anime = anidb.query(anidb.QUERY_ANIME, int(id)) if not form.validates(): return render.add(form, anime) metadata.newAnime(anime, form.d.subber, form.d.location, form.d.airTime, form.d.quality) raise web.seeother('/anime/%s' % int(id))
def POST(self, id): form = self.form() anime = anidb.query(anidb.QUERY_ANIME, int(id)) if not form.validates(): return render.add(form, anime) metadata.newAnime(anime, form.d.subber, form.d.location, form.d.quality) raise web.seeother('/anime/%s' % int(id))
def refreshForAnime(id): anime = anidb.query(anidb.QUERY_ANIME, id) episodes = list(model.get_episodes(id)) # update episodes that have new information for episode in episodes: if episode.title[:7]=="Episode": if anime.episodes[str(episode.episode)] != None: model.update_episode(id, episode.episode, anime.episodes[str(episode.episode)].titles['en'][0].title, anime.episodes[str(episode.episode)].airdate) # there are new episodes, create them if len(episodes)<anime.episodecount: currentEpisodeCount = len(list(episodes)) numberOfNewEpisodes = anime.episodecount-currentEpisodeCount for i in xrange(numberOfNewEpisodes): episodeNumber = currentEpisodeCount+(i+1) model.new_episode(anime.id, episodeNumber, anime.episodes[str(episodeNumber)].titles['en'][0].title, 1, anime.episodes[str(episodeNumber)].airdate)
def refreshForAnime(id): anime = anidb.query(anidb.QUERY_ANIME, id) episodes = list(model.get_episodes(id)) # update episodes that have new information for episode in episodes: if episode.title[:7] == "Episode": if anime.episodes[str(episode.episode)] != None: model.update_episode( id, episode.episode, anime.episodes[str(episode.episode)].titles['en'][0].title, anime.episodes[str(episode.episode)].airdate) # there are new episodes, create them if len(episodes) < anime.episodecount: currentEpisodeCount = len(list(episodes)) numberOfNewEpisodes = anime.episodecount - currentEpisodeCount for i in xrange(numberOfNewEpisodes): episodeNumber = currentEpisodeCount + (i + 1) model.new_episode( anime.id, episodeNumber, anime.episodes[str(episodeNumber)].titles['en'][0].title, 1, anime.episodes[str(episodeNumber)].airdate)
def GET(self, id): """ Show the groups doing releases (UDP only feature, we're using TCP) """ form = self.form() anime = anidb.query(anidb.QUERY_ANIME, int(id)) return render.add(form, anime)