From 485eebe9261bc59637596c8b666a712d963e828f Mon Sep 17 00:00:00 2001 From: Drazzilb <65743746+Drazzilb08@users.noreply.github.com> Date: Thu, 15 Feb 2024 17:03:15 -0800 Subject: [PATCH] fix: key error --- modules/queinatorr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/queinatorr.py b/modules/queinatorr.py index f8f193b..a16c008 100755 --- a/modules/queinatorr.py +++ b/modules/queinatorr.py @@ -180,7 +180,7 @@ def handle_queue(queue_dict, app): else: messages_dict[id]['messages'][message] = 1 if error: - if error in messages_dict[torrent]['messages']: + if error in messages_dict[id]['messages']: messages_dict[id]['messages'][error] += 1 else: messages_dict[id]['messages'][error] = 1 @@ -338,6 +338,8 @@ def process_instance(instance_type, url, api, pre_import_category, post_import_c # Retrieve the queue from Radarr or Sonarr instance queue = app.get_queue(instance_type) + logger.debug(f"Queue'{instance_type}'\n{json.dumps(queue, indent=4)}\n") + queue_dict = queued_items(queue, instance_type) logger.debug(f"Queue items for '{instance_type}'\n{json.dumps(queue_dict, indent=4)}\n") @@ -360,8 +362,6 @@ def process_instance(instance_type, url, api, pre_import_category, post_import_c if messages_dict: output_dict['queue'] = messages_dict - logger.debug(f"Queue items for '{instance_type}'\n{json.dumps(queue_dict, indent=4)}\n") - # Handle moving torrents from the queue to the specified categories in qBittorrent messages_dict = handle_qbit(queue_dict, qb, post_import_category, pre_import_category, days_to_keep) if messages_dict: