Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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)
def _update(self, info=None, **kwargs):
super(Episode, self)._update(info, **kwargs)
update_attributes(self, info, ['title'])
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'))
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:
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'
])
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']
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',
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'))