示例#1
0
 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)
示例#2
0
 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)
示例#3
0
    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]]
示例#4
0
    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]]
示例#5
0
 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)
示例#6
0
 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)
示例#7
0
 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)
示例#8
0
 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)