From 2cd6d94172a32271e1adf67f4cfa1a91d3a35977 Mon Sep 17 00:00:00 2001 From: boyska Date: Mon, 2 Dec 2024 18:55:48 +0100 Subject: [PATCH] public URLs are easy to copy --- caricari/private.py | 1 + caricari/templates/list.html | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/caricari/private.py b/caricari/private.py index ac1f83f..9ebb7c7 100644 --- a/caricari/private.py +++ b/caricari/private.py @@ -126,6 +126,7 @@ def list(request: Request): query = conn.query(database.Original).order_by(-database.Original.id).limit(100) for original in query: files.append(original.__dict__) + files[-1]["url"] = CONFIG["public"]["baseurl"] + "/dl/" + original.filepath data = {"files": files} if "application/json" in request.headers.get("accept", ""): diff --git a/caricari/templates/list.html b/caricari/templates/list.html index 0af5af4..a418380 100644 --- a/caricari/templates/list.html +++ b/caricari/templates/list.html @@ -16,11 +16,42 @@ {% for orig in files %} - {{orig.name}} + +{{orig.name}} + + {{orig.size}} {% endfor %} +