def get_lists(self, username=None): if not username: username = '******' cache_limit = self.__get_cache_limit('lists', 'updated_at', True) else: cache_limit = 0 url = '/users/%s/lists' % (utils.to_slug(username)) return self.__call_trakt(url, cache_limit=cache_limit)
def show_list(self, slug, section, username=None, auth=True, cached=True): if not username: username = '******' cache_limit = self.__get_cache_limit('lists', 'updated_at', cached) else: cache_limit = 1 # cache other user's list for one hour url = '/users/%s/lists/%s/items' % (utils.to_slug(username), slug) params = {'extended': 'full'} list_data = self.__call_trakt(url, params=params, auth=auth, cache_limit=cache_limit, cached=cached) return [item[item['type']] for item in list_data if item['type'] == TRAKT_SECTIONS[section][:-1]]
def get_user_profile(self, username=None, cached=True): if username is None: username = '******' url = '/users/%s' % (utils.to_slug(username)) return self.__call_trakt(url, cached=cached)
def get_list_header(self, slug, username=None, auth=True): if not username: username = '******' url = '/users/%s/lists/%s' % (utils.to_slug(username), slug) return self.__call_trakt(url, auth=auth)