コード例 #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' % (utils2.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' % (utils2.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' % (utils2.to_slug(username), slug)
        params = {'extended': 'full,images'}
        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' % (utils2.to_slug(username), slug)
        params = {'extended': 'full,images'}
        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_list_header(self, slug, username=None, auth=True):
     if not username: username = '******'
     url = '/users/%s/lists/%s' % (utils2.to_slug(username), slug)
     return self.__call_trakt(url, auth=auth)
コード例 #6
0
 def get_user_profile(self, username=None, cached=True):
     if username is None: username = '******'
     url = '/users/%s' % (utils2.to_slug(username))
     return self.__call_trakt(url, cached=cached)
コード例 #7
0
 def get_user_profile(self, username=None, cached=True):
     if username is None: username = '******'
     url = '/users/%s' % (utils2.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' % (utils2.to_slug(username), slug)
     return self.__call_trakt(url, auth=auth)