home · contact · privacy
Fix /yt_result showing "linked queries" before query cut-off date. master
authorChristian Heller <c.heller@plomlompom.de>
Thu, 20 Feb 2025 18:05:05 +0000 (19:05 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 20 Feb 2025 18:05:05 +0000 (19:05 +0100)
src/ytplom/http.py

index b173a229782490de0ce26c6ea135a5d7e4a2d014..4986a3c9e34bbb11cf99400ae1953d5d55651ba4 100644 (file)
@@ -352,7 +352,9 @@ class _TaskHandler(PlomHttpHandler):
     def _send_yt_result(self) -> None:
         video_id = YoutubeId(self.path_toks[2])
         with DbConn() as conn:
     def _send_yt_result(self) -> None:
         video_id = YoutubeId(self.path_toks[2])
         with DbConn() as conn:
-            linked_queries = YoutubeQuery.get_all_for_video(conn, video_id)
+            linked_queries = [
+                    q for q in YoutubeQuery.get_all(conn)
+                    if q.retrieved_at > self.server.config.queries_cutoff]
             try:
                 video_data = YoutubeVideo.get_one(conn, video_id)
             except NotFoundException:
             try:
                 video_data = YoutubeVideo.get_one(conn, video_id)
             except NotFoundException: