home · contact · privacy
Fix /yt_result showing file path even if file not .present.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 30 Nov 2024 18:23:21 +0000 (19:23 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 30 Nov 2024 18:23:21 +0000 (19:23 +0100)
src/ytplom/http.py

index 9027c98d8a731cf4cf8c410ae798b8d4cf05eda6..b2366d56376936b3dae6767b4ee7e7fc80d4a770 100644 (file)
@@ -310,7 +310,8 @@ class _TaskHandler(BaseHTTPRequestHandler):
         except NotFoundException:
             video_data = YoutubeVideo(video_id)
         try:
-            file_path = VideoFile.get_by_yt_id(conn, video_id).full_path
+            file = VideoFile.get_by_yt_id(conn, video_id)
+            file_path = file.full_path if file.present else None
         except NotFoundException:
             file_path = None
         conn.commit_close()