From 640a42d3084f53c6709d7aeb0966abbc4a74c3b1 Mon Sep 17 00:00:00 2001 From: retoor Date: Tue, 3 Dec 2024 21:59:57 +0100 Subject: [PATCH] Added thumnails. --- src/rupload/app.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/rupload/app.py b/src/rupload/app.py index 1bfce5c..22f1c78 100644 --- a/src/rupload/app.py +++ b/src/rupload/app.py @@ -276,12 +276,8 @@ async def handle_thumbnail(request: web.Request): if not safe_path.is_file(): return web.Response(status=400, text="Invalid file type.") - try: - pathlib.Path(safe_path).relative_to(request.app.upload_path) - except ValueError: - return web.Response(status=404, text="File not found.") - thumbnail_path = pathlib.Path(request.app.upload_path).joinpath(".thumbnail").joinpath(safe_path.name) + thumbnail_path = pathlib.Path(request.app.upload_folder).joinpath(".thumbnail").joinpath(safe_path.name) if not thumbnail_path.parent.exists(): thumbnail_path.parent.mkdir(exist_ok=True,parents=False)