Uprava queries a dotazovani se pres base query builder, fix nahledu fotky pro editor, cache na fotky

This commit is contained in:
Michal Kváček
2024-02-13 22:59:51 +01:00
parent 51316c492b
commit e28a6fce57
14 changed files with 209 additions and 90 deletions
+3 -2
View File
@@ -9,7 +9,8 @@ from utils.image import PhotoEditor
class PhotoEditorEndpoint(AuthEndpoint):
async def show_preview(self, photo_id: int, **kwargs):
@staticmethod
async def show_preview(photo_id: int, **kwargs):
async with get_session() as db:
photo = (await db.scalars(
select(models.Photo)
@@ -17,7 +18,7 @@ class PhotoEditorEndpoint(AuthEndpoint):
)).one()
basepath = get_photo_basepath(photo.flight_id)
filename = photo.filename
filename = f"{photo.filename}.{photo.filename_extension}"
original_filename = '_original_' + filename
if os.path.exists(f"{basepath}/{original_filename}"):