From 7465117b00c7478ea80c3cd37a89a3d9118b4b32 Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 31 Jan 2021 17:20:17 +0100 Subject: [PATCH] ValueError: invalid literal for int() for invalid dates sent by Plex --- resources/lib/library_sync/fill_metadata_queue.py | 4 ++-- resources/lib/plex_api/base.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/lib/library_sync/fill_metadata_queue.py b/resources/lib/library_sync/fill_metadata_queue.py index 38d6ecda..903301fe 100644 --- a/resources/lib/library_sync/fill_metadata_queue.py +++ b/resources/lib/library_sync/fill_metadata_queue.py @@ -40,8 +40,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 diff --git a/resources/lib/plex_api/base.py b/resources/lib/plex_api/base.py index 2cc59a8c..65f75887 100644 --- a/resources/lib/plex_api/base.py +++ b/resources/lib/plex_api/base.py @@ -230,8 +230,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): """