Catch invalid ratingKey property fetch from watch
MODIFY
plextraktsync/plex_api.py
plextraktsync/plex_api.py
@@ -511,8 +511,15 @@ def fetch_item(self, key: Union[int, str]) -> Optional[PlexLibraryItem]:
return PlexLibraryItem(media, plex=self)
def reload_item(self, pm: PlexLibraryItem):
+ try:
+ key = pm.item.ratingKey
+ except AttributeError as e:
+ logger.debug(f"Invalid object: {e}")
+ return None
+
self.fetch_item.cache_clear()
- return self.fetch_item(pm.item.ratingKey)
+
+ return self.fetch_item(key)
def media_url(self, m: PlexLibraryItem):
return f"{self.plex_base_url}/details?key={m.item.key}"

Catch invalid ratingKey property fetch from watch