Version to 1.16.4

pull/847/head v1.16.4
meisnate12 3 years ago
parent 1e0948cc2f
commit dd7544ad4f

@ -1 +1 @@
1.16.3-develop23 1.16.4

@ -38,7 +38,7 @@ class Tautulli:
if items is None: if items is None:
raise Failed("Tautulli Error: No Items found in the response") raise Failed("Tautulli Error: No Items found in the response")
section_id = self._section_id(library.name) section_id = library.Plex.key
rating_keys = [] rating_keys = []
for item in items: for item in items:
if (all_items or item["section_id"] == section_id) and len(rating_keys) < int(params['list_size']): if (all_items or item["section_id"] == section_id) and len(rating_keys) < int(params['list_size']):
@ -54,21 +54,11 @@ class Tautulli:
if new_item: if new_item:
rating_keys.append((new_item[0].ratingKey, "ratingKey")) rating_keys.append((new_item[0].ratingKey, "ratingKey"))
else: else:
logger.error(f"Plex Error: Item {item} not found") logger.error(f"Plex Error: Item not found {item}")
logger.debug("") logger.debug("")
logger.debug(f"{len(rating_keys)} Keys Found: {rating_keys}") logger.debug(f"{len(rating_keys)} Keys Found: {rating_keys}")
return rating_keys return rating_keys
def _section_id(self, library_name):
response = self._request(f"{self.url}/api/v2?apikey={self.apikey}&cmd=get_library_names")
section_id = None
for entry in response["response"]["data"]:
if entry["section_name"] == library_name:
section_id = entry["section_id"]
break
if section_id: return section_id
else: raise Failed(f"Tautulli Error: No Library named {library_name} in the response")
def _request(self, url): def _request(self, url):
if self.config.trace_mode: if self.config.trace_mode:
logger.debug(f"Tautulli URL: {url}") logger.debug(f"Tautulli URL: {url}")

@ -1,5 +1,5 @@
PlexAPI==4.10.1 PlexAPI==4.10.1
tmdbapis==1.0.3 tmdbapis==1.0.4
arrapi==1.3.1 arrapi==1.3.1
lxml==4.8.0 lxml==4.8.0
requests==2.27.1 requests==2.27.1

Loading…
Cancel
Save