From 7f1e111a83b6a7c8f7c202ef401e1ad980a2ae1e Mon Sep 17 00:00:00 2001 From: LemonNexus Date: Mon, 9 Feb 2026 17:14:47 +0000 Subject: [PATCH] fix(ui): remove attachment_type overwrite in loader to preserve parsed type - Removed code that was overwriting attachment_type for all items - Type is now correctly parsed from API (scope vs sight) - Sights tab now correctly shows items with Type='Sight' --- ui/attachment_selector.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ui/attachment_selector.py b/ui/attachment_selector.py index 939f594..420d491 100644 --- a/ui/attachment_selector.py +++ b/ui/attachment_selector.py @@ -33,17 +33,13 @@ class AttachmentLoaderThread(QThread): # Get amplifiers try: amps = api.get_all_amplifiers() - for amp in amps: - amp.attachment_type = "amplifier" all_attachments.extend(amps) except Exception as e: logger.warning(f"Could not load amplifiers: {e}") - # Get scopes/sights + # Get scopes/sights (both come from same endpoint) try: scopes = api.get_all_scopes() - for scope in scopes: - scope.attachment_type = "scope" all_attachments.extend(scopes) except Exception as e: logger.warning(f"Could not load scopes: {e}") @@ -51,8 +47,6 @@ class AttachmentLoaderThread(QThread): # Get absorbers try: absorbers = api.get_all_absorbers() - for absorber in absorbers: - absorber.attachment_type = "absorber" all_attachments.extend(absorbers) except Exception as e: logger.warning(f"Could not load absorbers: {e}")