From 02aa9a983b9421e5c917708d281a30ad4c92018b Mon Sep 17 00:00:00 2001 From: terrtia Date: Wed, 22 Jan 2025 11:59:28 +0100 Subject: [PATCH] fix: [module extrsctor] fix invalid object meta --- bin/lib/ail_core.py | 2 +- bin/lib/module_extractor.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/lib/ail_core.py b/bin/lib/ail_core.py index 98307db7..a1e6065c 100755 --- a/bin/lib/ail_core.py +++ b/bin/lib/ail_core.py @@ -90,7 +90,7 @@ def get_obj_queued(): return ['barcode', 'item', 'image', 'message', 'ocr', 'qrcode'] # screenshot ??? def get_objects_tracked(): - return ['barcode', 'decoded', 'item', 'pgp', 'message', 'ocr', 'qrcode', 'title'] + return ['barcode', 'decoded', 'item', 'message', 'ocr', 'pgp', 'qrcode', 'title'] def get_objects_retro_hunted(): return ['decoded', 'item', 'message', 'ocr'] diff --git a/bin/lib/module_extractor.py b/bin/lib/module_extractor.py index 2c1f08bf..0fd19b69 100755 --- a/bin/lib/module_extractor.py +++ b/bin/lib/module_extractor.py @@ -302,8 +302,12 @@ def get_extracted_by_match(extracted): obj_id = row_id[0] matches[str_obj]['subtype'] = subtype matches[str_obj]['id'] = obj_id - matches[str_obj]['icon'] = ail_objects.get_object_svg(ob_type, subtype, obj_id) - matches[str_obj]['link'] = ail_objects.get_object_link(ob_type, subtype, obj_id) + try: + matches[str_obj]['icon'] = ail_objects.get_object_svg(ob_type, subtype, obj_id) + matches[str_obj]['link'] = ail_objects.get_object_link(ob_type, subtype, obj_id) + except TypeError: + matches[str_obj]['icon'] = {'style': 'fas', 'icon': '\uf00d', 'color': 'red', 'radius': 5} + matches[str_obj]['link'] = '' matches[str_obj]['matches'] = []