add fallback thumb for queue, add ta_download to thumb validator

This commit is contained in:
Simon 2025-07-11 19:53:48 +07:00
parent 02bb52f276
commit 42a8ae2e9f
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 11 additions and 1 deletions

View File

@ -359,6 +359,9 @@ class PendingList(PendingIndex):
if "thumbnail" in video_data:
return video_data["thumbnail"]
if video_data.get("thumbnails"):
return video_data["thumbnails"][-1]["url"]
return None
def __extract_published(self, video_data) -> str | int | None:

View File

@ -265,7 +265,7 @@ class ValidatorCallback:
def run(self):
"""run the task for page"""
print(f"{self.index_name}: validate artwork")
if self.index_name == "ta_video":
if self.index_name in ["ta_video", "ta_download"]:
self._validate_videos()
elif self.index_name == "ta_channel":
self._validate_channels()
@ -325,6 +325,13 @@ class ThumbValidator:
},
"name": "ta_playlist",
},
{
"data": {
"query": {"term": {"status": {"value": "pending"}}},
"_source": ["youtube_id", "vid_thumb_url"],
},
"name": "ta_download",
},
]
def __init__(self, task=False):