Add fallback if checksum updatedAt is missing
This commit is contained in:
parent
009fc9937a
commit
923c413921
2 changed files with 6 additions and 3 deletions
|
@ -48,7 +48,8 @@ class FullSync(common.libsync_mixin):
|
|||
plex_id = int(xml_item.get('ratingKey'))
|
||||
if not self.repair and self.plexdb.checksum(plex_id, self.plex_type) == \
|
||||
int('%s%s' % (plex_id,
|
||||
xml_item.get('updatedAt'))):
|
||||
xml_item.get('updatedAt',
|
||||
xml_item.get('addedAt', 1541572987)))):
|
||||
# Already got EXACTLY this item in our DB
|
||||
self.plexdb.update_last_sync(plex_id,
|
||||
self.plex_type,
|
||||
|
|
|
@ -101,8 +101,10 @@ class API(object):
|
|||
Returns the unique int <ratingKey><updatedAt> or None if this failes
|
||||
"""
|
||||
try:
|
||||
return cast(int, '%s%s' % (self.item.get('ratingKey'),
|
||||
self.item.get('updatedAt')))
|
||||
return int('%s%s' % (self.item.get('ratingKey'),
|
||||
self.item.get('updatedAt',
|
||||
self.item.get('addedAt',
|
||||
1541572987))))
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in a new issue