예제 #1
0
파일: anorak.py 프로젝트: bitwhacker/Anorak
 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))
예제 #2
0
파일: anorak.py 프로젝트: echel0n/Anorak
 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))
예제 #3
0
파일: metadata.py 프로젝트: Fursje/Anorak
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)
예제 #4
0
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)
예제 #5
0
파일: anorak.py 프로젝트: bitwhacker/Anorak
 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)
예제 #6
0
 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)