tautulli fix

pull/282/head
meisnate12 4 years ago
parent e94d963f23
commit 5c89ee5478

@ -10,15 +10,15 @@ builders = ["tautulli_popular", "tautulli_watched"]
class TautulliAPI: class TautulliAPI:
def __init__(self, params): def __init__(self, params):
self.url = params["url"]
self.apikey = params["apikey"]
try: try:
response = self._request(f"{params['url']}/api/v2?apikey={params['apikey']}&cmd=get_library_names") response = self._request(f"{self.url}/api/v2?apikey={self.apikey}&cmd=get_library_names")
except Exception: except Exception:
util.print_stacktrace() util.print_stacktrace()
raise Failed("Tautulli Error: Invalid url") raise Failed("Tautulli Error: Invalid url")
if response["response"]["result"] != "success": if response["response"]["result"] != "success":
raise Failed(f"Tautulli Error: {response['response']['message']}") raise Failed(f"Tautulli Error: {response['response']['message']}")
self.url = params["url"]
self.apikey = params["apikey"]
def get_items(self, library, params): def get_items(self, library, params):
query_size = int(params["list_size"]) + int(params["list_buffer"]) query_size = int(params["list_size"]) + int(params["list_buffer"])

Loading…
Cancel
Save