From 642efe934a88b0f047c923a6579f3bc83e27e1a2 Mon Sep 17 00:00:00 2001 From: Victor Mylle Date: Tue, 7 Mar 2023 12:26:45 +0000 Subject: [PATCH] Fixing small caching problem --- backend/src/routers/signvideo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/routers/signvideo.py b/backend/src/routers/signvideo.py index 2b7f480..8cf6849 100644 --- a/backend/src/routers/signvideo.py +++ b/backend/src/routers/signvideo.py @@ -102,6 +102,10 @@ async def sign_video_thumbnail( if not sign_video: raise BaseException("Sign video not found") + # check if the video exists + if not os.path.exists(f"{settings.DATA_PATH}/{sign_video.path}"): + raise BaseException("Video not found") + # extract the thumbnail from the video bytes = extract_thumbnail(f"{settings.DATA_PATH}/{sign_video.path}")