def show_episode(trakt_slug, season_index, episode_index): show_info = trakt.show(trakt_slug) episode_info = trakt.show_episode(trakt_slug, season_index, episode_index) cache_key = 'show-{0}-{1}-{2}-magnets'.format(trakt_slug, season_index, episode_index) cache_update_func = functools.partial(__show_episode_magnets, providers=[ eztv, kickass ], show_info=show_info, episode_info=episode_info) cache_data_expiration = cache.HOUR * 2 episode_info['magnets'] = cache.cache_optional(cache_key, cache_update_func, cache_data_expiration) or [] return episode_info
def show_episode(trakt_slug, season_index, episode_index): show_info = trakt.show(trakt_slug) episode_info = trakt.show_episode(trakt_slug, season_index, episode_index) cache_key = 'show-{0}-{1}-{2}-magnets'.format(trakt_slug, season_index, episode_index) # cache_update_func = functools.partial(__show_episode_magnets, providers=[ eztv, kickass ], show_info=show_info, episode_info=episode_info) cache_update_func = functools.partial(__show_episode_magnets, providers=[eztv, kickass], show_info=show_info, episode_info=episode_info) cache_data_expiration = cache.HOUR * 2 episode_info['magnets'] = cache.cache_optional( cache_key, cache_update_func, cache_data_expiration) or [] return episode_info
def show(trakt_slug): return trakt.show(trakt_slug, seasons_needed=True)