From e2f27c14d4d4829f599259cf291a933f0a17e3d2 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Tue, 30 Nov 2021 10:18:30 -0500 Subject: [PATCH] fix cache error --- modules/cache.py | 2 +- modules/webhooks.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/cache.py b/modules/cache.py index 366308a9..d88d4509 100644 --- a/modules/cache.py +++ b/modules/cache.py @@ -377,4 +377,4 @@ class Cache: with sqlite3.connect(self.cache_path) as connection: connection.row_factory = sqlite3.Row with closing(connection.cursor()) as cursor: - cursor.execute(f"INSERT OR IGNORE INTO {arr}_adds({id_type}, library) VALUES(?)", (t_id, library)) + cursor.execute(f"INSERT OR IGNORE INTO {arr}_adds({id_type}, library) VALUES(?, ?)", (t_id, library)) diff --git a/modules/webhooks.py b/modules/webhooks.py index cbe3f47e..d7889bb2 100644 --- a/modules/webhooks.py +++ b/modules/webhooks.py @@ -23,7 +23,10 @@ class Webhooks: logger.debug(f"Webhook: {webhook}") if webhook == "notifiarr": url, params = self.notifiarr.get_url("notification/plex/") - response = self.config.get(url, json=json, params=params) + for x in range(6): + response = self.config.get(url, json=json, params=params) + if response.status_code < 500: + break else: response = self.config.post(webhook, json=json) try: