Exemplo n.º 1
0
def next_released_from_given_episode(show, season, episode):
    try:

        next_episode = get_show_by_name(show).get_episode(int(season), int(episode)).next()

        if not next_episode:
            raise EpisodeNotFoundException

        return json_response({
            'status': get_show_by_name(show).get_episode(int(season),
                                                         int(episode)).next().released()
        })
    except EpisodeNotFoundException:
        return json_response({'error': 'Episode not found'}, 404)
Exemplo n.º 2
0
def next(show):
    try:
        return json_response({
            'episode': get_show_by_name(show).next_episode()
        })
    except EpisodeNotFoundException:
        return json_response({'error': 'Episode not found'}, 404)
Exemplo n.º 3
0
def next_from_given_episode(show, season, episode):
    try:
        return json_response({
            'episode': get_show_by_name(show).get_episode(int(season), int(episode)).next()
        })
    except EpisodeNotFoundException:
        return json_response({'error': 'Episode not found'}, 404)
Exemplo n.º 4
0
def released(show, season, episode):
    try:
        return json_response({
            'status': get_show_by_name(show).episode_released(int(season), int(episode))
        })
    except EpisodeNotFoundException:
        return json_response({
            'status': False
        })
Exemplo n.º 5
0
def discover_shows():
    result = []

    for epguides_name in list_all_epguides_keys_redis():
        try:
            show = get_show_by_name(epguides_name)
            if not show:
                continue

            show.episodes = "{0}show/{1}/".format(app.config['BASE_URL'], epguides_name)
            show.next_episode = "{0}show/{1}/next".format(app.config['BASE_URL'], epguides_name)
            show.last_episode = "{0}show/{1}/last".format(app.config['BASE_URL'], epguides_name)
            show.imdb_url = "http://www.imdb.com/title/{0}".format(show.imdb_id)
            show.epguides_url = "http://www.epguides.com/{0}".format(epguides_name)
            result.append(show)
        except EpisodeNotFoundException:
            continue

    return json_response(result)
Exemplo n.º 6
0
def view_show_info(show):
    try:
        return json_response(get_show_by_name(show))
    except EpisodeNotFoundException:
        return json_response({'error': 'Show not found'}, 404)