From 18f7b20b39005a4fdbf4ea673df5440e385a2666 Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Fri, 12 Apr 2024 14:46:02 +0200 Subject: [PATCH] Added color and qty to minifigs --- app.py | 4 +++- lego.py | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 0d28680..8c4c944 100644 --- a/app.py +++ b/app.py @@ -24,6 +24,8 @@ def sets(tmp): with open('./static/sets/'+tmp+'/info.json') as info: info_file = json.loads(info.read()) + with open('./static/sets/'+tmp+'/minifigs.json') as info: + minifigs_file = json.loads(info.read()) with open('./static/sets/'+tmp+'/inventory.json') as inventory: inventory_file = json.loads(inventory.read()) with open('./info/'+tmp+'.json') as info: @@ -78,7 +80,7 @@ def sets(tmp): return ('', 204) else: return render_template('bootstrap_table.html', tmp=tmp,title=info_file['name'], - info_file=info_file,inventory_file=inventory_file,json_file=json_file) + info_file=info_file,inventory_file=inventory_file,json_file=json_file,minifigs_file=minifigs_file) diff --git a/lego.py b/lego.py index 88a28ad..f738aa2 100644 --- a/lego.py +++ b/lego.py @@ -159,6 +159,8 @@ for x in response["results"]: for i in response["results"]: part = { "name": i["part"]["name"], + "quantity": i["quantity"], + "color_name": i["color"]["name"], "part_num": i["part"]["part_num"], "part_img_url": i["part"]["part_img_url"]