From 87d582658bbb5afd92cc88ebdf630eaea2b62bb6 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 2 Jun 2021 14:41:57 -0400 Subject: [PATCH] made reload quicker --- modules/plex.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/plex.py b/modules/plex.py index 29c3a43d..9a4e1898 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -405,12 +405,16 @@ class PlexAPI: @retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_plex) def get_guids(self, item): + self.reload(item) + return item.guids + + @retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_plex) + def reload(self, item): item.reload(checkFiles=False, includeAllConcerts=False, includeBandwidths=False, includeChapters=False, includeChildren=False, includeConcerts=False, includeExternalMedia=False, includeExtras=False, includeFields='', includeGeolocation=False, includeLoudnessRamps=False, includeMarkers=False, includeOnDeck=False, includePopularLeaves=False, includePreferences=False, includeRelated=False, includeRelatedCount=0, includeReviews=False, includeStations=False) - return item.guids @retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_plex) def edit_query(self, item, edits, advanced=False): @@ -418,7 +422,7 @@ class PlexAPI: item.editAdvanced(**edits) else: item.edit(**edits) - item.reload() + self.reload(item) @retry(stop_max_attempt_number=6, wait_fixed=10000, retry_on_exception=util.retry_if_not_plex) def upload_image(self, item, location, poster=True, url=True): @@ -570,7 +574,7 @@ class PlexAPI: for i, item in enumerate(all_items, 1): util.print_return(f"Processing: {i}/{len(all_items)} {item.title}") add_item = True - self.query(item.reload) + self.reload(item) for collection in item.collections: if collection.id in collection_indexes: add_item = False