Updated readme and first time running

This commit is contained in:
2024-12-26 18:17:54 +01:00
parent e372018a2c
commit ba2138a1af
2 changed files with 12 additions and 1 deletions

10
app.py
View File

@@ -508,7 +508,15 @@ def generate_unique_set_unique():
@app.route('/',methods=['GET','POST'])
def index():
set_list = []
theme_file = np.loadtxt("themes.csv",delimiter=",",dtype="str")
try:
theme_file = np.loadtxt("themes.csv",delimiter=",",dtype="str")
except: #First time running, no csvs.
initialize_database()
urls = ["themes","sets","colors"]
for i in urls:
download_and_unzip("https://cdn.rebrickable.com/media/downloads/"+i+".csv.gz")
get_nil_images()
return redirect('/create')
if request.method == 'GET':