From 0d38808e16149a1a0b071e32c7be8643c13931a6 Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Sun, 15 Jan 2023 10:37:05 +0100 Subject: [PATCH] Updated docker-compose --- docker-compose.yml | 5 +++-- main.py | 15 ++++++++++++--- test.json | 18 +++++++++++++++--- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e2a7201..e29ce45 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,12 @@ version: '3.3' services: comicopds: - image: comicopds + image: . container_name: comicopds restart: unless-stopped ports: - '5000:5000' volumes: - - '/opt/data/Comics/ComicRack:/library:ro' + #- '/opt/data/Comics/ComicRack:/library:ro' + - '~/ComicsTest/Comics:/library:ro' - '${PWD}/:/app' diff --git a/main.py b/main.py index c118287..1ef9d68 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,4 @@ -from flask import Flask, send_from_directory, request +from flask import Flask, render_template, send_from_directory, request from flask_httpauth import HTTPBasicAuth from werkzeug.security import check_password_hash from gevent.pywsgi import WSGIServer @@ -31,6 +31,14 @@ def verify_password(username, password): @app.route("/") +def startpage(): + conn = sqlite3.connect('app.db') + cursor = conn.cursor() + cursor.execute("select * from comics;") + result = cursor.fetchall() + conn.close() + return render_template("start.html", result=result) + @app.route("/healthz") def healthz(): return "ok" @@ -90,11 +98,12 @@ def send_content(path): @app.route("/catalog/") @auth.login_required def catalog(path=""): + #print("PRESSED ON") start_time = timeit.default_timer() - print(request.root_url) + #print(request.root_url) c = fromdir(request.root_url, request.url, config.CONTENT_BASE_DIR, path) elapsed = timeit.default_timer() - start_time - print(elapsed) + #print("RENDERED IN: " + str(elapsed)) return c.render() diff --git a/test.json b/test.json index df7dc2d..12703fc 100644 --- a/test.json +++ b/test.json @@ -62,13 +62,25 @@ ] }, { - "Aquaman": [ + "number 1": [ { "title": "", "volume": "", "publisher": "", - "series": "aquaman", - "issue": ["2","3","5","10","22"] + "series": "", + "issue": ["1"] + } + ] + } +, + { + "Aquaman": [ + { + "title": ["Tyrant King", "The Deluge Act Three", "Warhead Part One"], + "volume": "", + "publisher": "", + "series": "", + "issue": "" } ] }