示例#1
0
    def _update(self, info=None, **kwargs):
        super(Show, self)._update(info, **kwargs)

        update_attributes(self, info, ["title", "watchers"])  # trending

        if info.get("year"):
            self.year = int(info["year"])
示例#2
0
    def _update(self, info=None, **kwargs):
        if not info:
            return

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

        update_attributes(
            self,
            info,
            [
                'title',

                # Extended Info
                'available_translations',
                'runtime',
            ])

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

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

        if 'number_abs' in info:
            self.number_abs = info.get('number_abs')
示例#3
0
    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:
            self.in_watchlist = in_watchlist

        self.rating = Rating._construct(self._client, info) or self.rating
示例#4
0
    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)
        if info.get('year'):
            self.year = int(info['year'])

        # Extended Info
        if info.get('runtime'):
            self.runtime = info['runtime']

        if 'released' in info:
            self.released = from_iso8601_date(info.get('released'))

        if 'updated_at' in info:
            self.updated_at = from_iso8601_datetime(info.get('updated_at'))
示例#5
0
    def _update(self, info=None):
        super(PublicList, self)._update(info)

        if not info:
            return

        update_attributes(self, info, ['comment_total', 'like_total'])
示例#6
0
    def _update(self, info=None, is_watched=None, is_collected=None, **kwargs):
        if not info:
            return

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

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

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

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

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

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

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

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

        if is_collected is not None:
            self.is_collected = is_collected
示例#7
0
    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)
        if info.get('year'):
            self.year = int(info['year'])

        # Extended Info
        if info.get('runtime'):
            self.runtime = info['runtime']

        if 'released' in info:
            self.released = from_iso8601_date(info.get('released'))

        if 'updated_at' in info:
            self.updated_at = from_iso8601_datetime(info.get('updated_at'))
示例#8
0
    def _update(self, info=None):
        if not info:
            return

        super(CustomList, self)._update(info)

        update_attributes(self, info, ['privacy'])
示例#9
0
    def _update(self, info=None, **kwargs):
        if not info:
            return

        update_attributes(self, info, [
            'aired',
            'completed'
        ])
示例#10
0
    def _update(self, info=None, **kwargs):
        if not info:
            return

        update_attributes(self, info, [
            'aired',
            'completed'
        ])
示例#11
0
    def _update(self, info=None):
        if not info:
            return

        super(CustomList, self)._update(info)

        update_attributes(self, info, [
            'privacy'
        ])
示例#12
0
    def _update(self, info=None, **kwargs):
        if not info:
            return

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

        # Set timestamps
        if 'listed_at' in info:
            self.listed_at = from_iso8601_datetime(info.get('listed_at'))
示例#13
0
    def _update(self, info=None, **kwargs):
        super(Movie, self)._update(info, **kwargs)

        update_attributes(self, info, [
            'title',
            'watchers'  # trending
        ])

        if info.get('year'):
            self.year = int(info['year'])
示例#14
0
    def _update(self, info=None, **kwargs):
        super(Movie, self)._update(info, **kwargs)

        update_attributes(self, info, [
            'title',
            'watchers'  # trending
        ])

        if info.get('year'):
            self.year = int(info['year'])
示例#15
0
    def _update(self, info=None):
        if not info:
            return

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

        update_attributes(self, info, [
            'name', 'description', 'likes', 'allow_comments',
            'display_numbers', 'comment_count', 'item_count'
        ])
示例#16
0
    def _update(self, info=None, **kwargs):
        if not info:
            return

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

        # Set timestamps
        if 'listed_at' in info:
            self.listed_at = from_iso8601_datetime(info.get('listed_at'))
示例#17
0
    def _update(self, info=None):
        if not info:
            return

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

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

        update_attributes(self, info,
                          ['username', 'name', 'private', 'vip', 'vip_ep'])
示例#18
0
    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']
示例#19
0
    def _update(self, info=None):
        if not info:
            return

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

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

        update_attributes(self, info, [
            'parent_id', 'comment', 'spoiler', 'review', 'replies', 'likes',
            'user', 'user_rating'
        ])
示例#20
0
    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'))
示例#21
0
    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']
示例#22
0
    def _update(self, info=None, **kwargs):
        if not info:
            return

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

        update_attributes(
            self,
            info,
            [
                'title',

                # Watched, Collected, and Played
                'watcher_count',
                'play_count',
                'collected_count',
                'collector_count',

                # Recommended
                'user_count',

                # Trending
                'watchers',

                # Extended Info
                'airs',
                'runtime',
                'certification',
                'network',
                'country',
                'status',
                'homepage',
                'language',
                'available_translations',
                'genres',
                'aired_episodes'
            ])

        # Ensure `year` attribute is an integer (fixes incorrect type returned by search)
        if info.get('year'):
            self.year = int(info['year'])

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

        if 'updated_at' in info:
            self.updated_at = from_iso8601_datetime(info.get('updated_at'))
示例#23
0
    def _update(self, info=None):
        if not info:
            return

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

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

            'allow_comments',
            'display_numbers',

            'comment_count',
            'item_count'
        ])
示例#24
0
    def _update(self, info=None):
        if not info:
            return

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

        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', 'privacy', 'likes', 'allow_comments',
            'display_numbers', 'sort_by', 'sort_how', 'comment_count',
            'item_count'
        ])
示例#25
0
    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"))
示例#26
0
    def _update(self, info=None, **kwargs):
        if not info:
            return

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

        update_attributes(self, info, [
            'title',

            # Extended Info
            'available_translations'
        ])

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

        if 'updated_at' in info:
            self.updated_at = from_iso8601_datetime(info.get('updated_at'))
示例#27
0
    def _update(self, info=None, in_watchlist=None, **kwargs):
        if not info:
            return

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

        # 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
示例#28
0
    def _update(self, info=None, is_watched=None, is_collected=None, **kwargs):
        super(Video, self)._update(info, **kwargs)

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

        # 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'))

        if 'paused_at' in info:
            self.paused_at = from_iso8601(info.get('paused_at'))

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

        if is_collected is not None:
            self.is_collected = is_collected
示例#29
0
    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',
            'aired_episodes'
        ])

        # Ensure `year` attribute is an integer (fixes incorrect type returned by search)
        if info.get('year'):
            self.year = int(info['year'])

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

        if 'updated_at' in info:
            self.updated_at = from_iso8601_datetime(info.get('updated_at'))
示例#30
0
    def _update(self, info=None, is_watched=None, is_collected=None, **kwargs):
        if not info:
            return

        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 = info.get('id')

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

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

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

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

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

        if is_collected is not None:
            self.is_collected = is_collected
示例#31
0
    def _update(self, info=None, is_watched=None, is_collected=None, **kwargs):
        super(Video, self)._update(info, **kwargs)

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

        # 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'))

        if 'paused_at' in info:
            self.paused_at = from_iso8601(info.get('paused_at'))

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

        if is_collected is not None:
            self.is_collected = is_collected
示例#32
0
    def _update(self, info=None):
        if not info:
            return

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

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

        update_attributes(self, info, [
            'parent_id',

            'comment',

            'spoiler',
            'review',

            'replies',
            'likes',

            'user',
            'user_rating'
        ])
示例#33
0
    def _update(self, info=None):
        if not info:
            return

        update_attributes(self, info, ['name'])
示例#34
0
    def _update(self, info=None, **kwargs):
        super(Episode, self)._update(info, **kwargs)

        update_attributes(self, info, ['title'])
示例#35
0
    def _update(self, info=None, **kwargs):
        super(Episode, self)._update(info, **kwargs)

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