ean vs barcode

This commit is contained in:
C committed 2026-01-04 14:53:53 -08:00
1 parent 7fbf415acf
commit daf6f215fe
3 files changed
+25 -3

No files matched your search

+6 -1
View File
@@ -101,12 +101,17 @@ class AsyncBricksetAPI:
)
set_data = result["sets"][0]
# Try to get UPC barcode, fall back to EAN if not available
barcode_data = set_data.get("barcode", {})
upc_code = barcode_data.get("UPC") or barcode_data.get("EAN")
our_set = {
"set_num": set_data["number"],
"set_name": set_data["name"],
"set_theme": set_data["theme"],
"set_image": set_data["image"]["thumbnailURL"],
"set_barcode": set_data["barcode"]["UPC"],
"set_barcode": upc_code,
"set_retailprice": round(
set_data["LEGOCom"]["US"]["retailPrice"]
),