Merge pull request #1320 from croneter/fix-valueerror

ValueError: invalid literal for int() for invalid dates sent by Plex
This commit is contained in:
croneter 2021-01-31 17:52:45 +01:00 committed by GitHub
commit 538832bed5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -41,8 +41,8 @@ class FillMetadataQueue(common.LibrarySyncMixin,
plex_id = int(xml.get('ratingKey'))
checksum = int('{}{}'.format(
plex_id,
xml.get('updatedAt',
xml.get('addedAt', '1541572987')).replace('-', '')))
abs(int(xml.get('updatedAt',
xml.get('addedAt', '1541572987'))))))
if (not self.repair and
plexdb.checksum(plex_id, section.plex_type) == checksum):
continue

View File

@ -231,8 +231,8 @@ class Base(object):
addedAt is used.
"""
return int('%s%s' % (self.xml.get('ratingKey'),
self.xml.get('updatedAt') or
self.xml.get('addedAt', '1541572987')))
abs(int(self.xml.get('updatedAt') or
self.xml.get('addedAt', '1541572987')))))
def title(self):
"""