How to use the trakt.core.helpers.popitems function in trakt

To help you get started, we’ve selected a few trakt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trakt / Plex-Trakt-Scrobbler / Trakttv.bundle / Contents / Libraries / Shared / trakt / interfaces / sync / core / mixins.py View on Github external
def add(self, items, **kwargs):
        response = self.http.post(
            data=items,
            **popitems(kwargs, [
                'authenticated',
                'validate_token'
            ])
        )

        return self.get_data(response, **kwargs)
github fuzeman / trakt.py / trakt / interfaces / users / settings.py View on Github external
def get(self, **kwargs):
        response = self.http.get(
            **popitems(kwargs, [
                'authenticated',
                'validate_token'
            ])
        )

        return self.get_data(response, **kwargs)
github trakt / Plex-Trakt-Scrobbler / Trakttv.bundle / Contents / Libraries / Shared / trakt / interfaces / sync / core / mixins.py View on Github external
def get(self, media=None, store=None, params=None, query=None, flat=False, **kwargs):
        if not params:
            params = []

        params.insert(0, media)

        # Request resource
        response = self.http.get(
            params=params,
            query=query,
            **popitems(kwargs, [
                'authenticated',
                'validate_token'
            ])
        )

        # Parse response
        items = self.get_data(response, **kwargs)

        if isinstance(items, requests.Response):
            return items

        if type(items) is not list and not isinstance(items, PaginationIterator):
            return None

        # Map items
        return SyncMapper.process(
github sharkykh / TraktPlaybackProgressManager / trakt / interfaces / sync / core / mixins.py View on Github external
def get(self, media=None, store=None, params=None, query=None, flat=False, **kwargs):
        if not params:
            params = []

        params.insert(0, media)

        # Request resource
        response = self.http.get(
            params=params,
            query=query,
            **popitems(kwargs, [
                'authenticated',
                'validate_token'
            ])
        )

        # Parse response
        items = self.get_data(response, **kwargs)

        if isinstance(items, requests.Response):
            return items

        if type(items) is not list and not isinstance(items, PaginationIterator):
            return None

        # Map items
        return SyncMapper.process(
github fuzeman / trakt.py / trakt / interfaces / shows / __init__.py View on Github external
def progress(self, progress_type, id, hidden=False, specials=False, count_specials=True, **kwargs):
        query = {
            'hidden': hidden,
            'specials': specials,
            'count_specials': count_specials
        }

        response = self.http.get(str(id), [
            'progress', progress_type
        ], query=query, **popitems(kwargs, [
            'authenticated',
            'validate_token'
        ]))

        item = self.get_data(response, **kwargs)

        if isinstance(item, requests.Response):
            return item

        return ProgressMapper.progress(self.client, progress_type, item)
github sharkykh / TraktPlaybackProgressManager / trakt / interfaces / sync / core / mixins.py View on Github external
def delete(self, playbackid, **kwargs):
        response = self.http.delete(
            path=str(playbackid),
            **popitems(kwargs, [
                'authenticated',
                'validate_token'
            ])
        )

        return 200 <= response.status_code < 300
github fuzeman / trakt.py / trakt / interfaces / users / lists / list_.py View on Github external
def like(self, username, id, **kwargs):
        # Send request
        response = self.http.post(
            '/users/%s/lists/%s/like' % (clean_username(username), id),
            **popitems(kwargs, [
                'authenticated',
                'validate_token'
            ])
        )

        return 200 <= response.status_code < 300
github trakt / Plex-Trakt-Scrobbler / Trakttv.bundle / Contents / Libraries / Shared / trakt / interfaces / users / settings.py View on Github external
def get(self, **kwargs):
        response = self.http.get(
            **popitems(kwargs, [
                'authenticated',
                'validate_token'
            ])
        )

        return self.get_data(response, **kwargs)
github trakt / Plex-Trakt-Scrobbler / Trakttv.bundle / Contents / Libraries / Shared / trakt / interfaces / users / lists / list_.py View on Github external
def unlike(self, username, id, **kwargs):
        # Send request
        response = self.http.delete(
            '/users/%s/lists/%s/like' % (clean_username(username), id),
            **popitems(kwargs, [
                'authenticated',
                'validate_token'
            ])
        )

        return 200 <= response.status_code < 300