How to use the trakt.objects.core.helpers.update_attributes 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 / objects / media.py View on Github external
def _update(self, info=None, in_watchlist=None, **kwargs):
        if not info:
            return

        update_attributes(self, info, [
            'overview',
            'score'
        ])

        if 'images' in info:
            self.images = info['images']

        # Set timestamps
        if 'listed_at' in info:
            self.listed_at = from_iso8601(info.get('listed_at'))

        # Set flags
        if in_watchlist is not None:
            self.in_watchlist = in_watchlist

        self.rating = Rating._construct(self._client, info) or self.rating
github trakt / Plex-Trakt-Scrobbler / Trakttv.bundle / Contents / Libraries / Shared / trakt / objects / movie.py View on Github external
def _update(self, info=None, **kwargs):
        if not info:
            return

        super(Movie, self)._update(info, **kwargs)

        update_attributes(self, info, [
            'title',

            # Trending
            'watchers',

            # Extended Info
            'tagline',
            'certification',
            'homepage',
            'trailer',
            'language',
            'available_translations',
            'genres'
        ])

        # Ensure `year` attribute is an integer (fixes incorrect type returned by search)
github timbooo / traktforalfred / trakt / objects / episode.py View on Github external
def _update(self, info=None, **kwargs):
        super(Episode, self)._update(info, **kwargs)

        update_attributes(self, info, ['title'])
github trakt / Plex-Trakt-Scrobbler / Trakttv.bundle / Contents / Libraries / Shared / trakt / objects / video.py View on Github external
def _update(self, info=None, is_watched=None, is_collected=None, **kwargs):
        super(Video, self)._update(info, **kwargs)

        update_attributes(self, info, [
            'plays',
            'progress'
        ])

        if 'action' in info:
            self.action = info.get('action')

        if 'id' in info:
            self.id = int(info.get('id'))

        # Set timestamps
        if 'last_watched_at' in info:
            self.last_watched_at = from_iso8601(info.get('last_watched_at'))

        if 'collected_at' in info:
            self.collected_at = from_iso8601(info.get('collected_at'))
github fuzeman / trakt.py / trakt / objects / media.py View on Github external
def _update(self, info=None, in_watchlist=None, **kwargs):
        if not info:
            return

        update_attributes(self, info, [
            # Extended Info
            'overview',

            # Search
            'score'
        ])

        if 'images' in info:
            self.images = info['images']

        # Set timestamps
        if 'listed_at' in info:
            self.listed_at = from_iso8601_datetime(info.get('listed_at'))

        # Set flags
        if in_watchlist is not None:
github fuzeman / trakt.py / trakt / objects / list / base.py View on Github external
def _update(self, info=None):
        if not info:
            return

        if 'liked_at' in info:
            self.liked_at = from_iso8601_datetime(info.get('liked_at'))

        if 'updated_at' in info:
            self.updated_at = from_iso8601_datetime(info.get('updated_at'))

        update_attributes(self, info, [
            'name',
            'description',
            'likes',

            'allow_comments',
            'display_numbers',

            'comment_count',
            'item_count'
        ])
github fuzeman / trakt.py / trakt / objects / list / custom.py View on Github external
def _update(self, info=None):
        if not info:
            return

        super(CustomList, self)._update(info)

        update_attributes(self, info, [
            'privacy'
        ])

        # Update with user details
        user = info.get('user', {})

        if user.get('username'):
            self.username = user['username']
github trakt / Plex-Trakt-Scrobbler / Trakttv.bundle / Contents / Libraries / Shared / trakt / objects / show.py View on Github external
def _update(self, info=None, **kwargs):
        if not info:
            return

        super(Show, self)._update(info, **kwargs)

        update_attributes(self, info, [
            'title',

            # Trending
            'watchers',

            # Extended Info
            'airs',
            'runtime',
            'certification',
            'network',
            'country',
            'status',
            'homepage',
            'language',
            'available_translations',
            'genres',
github trakt / Plex-Trakt-Scrobbler / Trakttv.bundle / Contents / Libraries / Shared / trakt / objects / season.py View on Github external
def _update(self, info=None, **kwargs):
        if not info:
            return

        super(Season, self)._update(info, **kwargs)

        update_attributes(self, info, [
            # Extended Info
            'episode_count',
            'aired_episodes'
        ])

        # Extended Info
        if 'first_aired' in info:
            self.first_aired = from_iso8601_datetime(info.get('first_aired'))