From 4d9be9853c8cd92d2076ff8addfb45e6a89c3d93 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 12 Jul 2025 18:15:46 +0700 Subject: [PATCH] fix _add_video empty return --- backend/download/src/queue.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/download/src/queue.py b/backend/download/src/queue.py index 8bf59e83..25f6a8e9 100644 --- a/backend/download/src/queue.py +++ b/backend/download/src/queue.py @@ -165,7 +165,7 @@ class PendingList(PendingIndex): else: raise ValueError(f"invalid url_type: {entry}") - def _add_video(self, url, vid_type): + def _add_video(self, url, vid_type) -> dict | None: """add video to list""" if self.auto_start and url in set( i["youtube_id"] for i in self.all_pending @@ -175,10 +175,11 @@ class PendingList(PendingIndex): if url in self.missing_videos or url in self.to_skip: print(f"{url}: skipped adding already indexed video to download.") - else: - to_add = self._parse_video(url, vid_type) - if to_add: - self.missing_videos.append(to_add) + return None + + to_add = self._parse_video(url, vid_type) + if to_add: + self.missing_videos.append(to_add) return to_add