mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-12-22 18:00:17 +00:00
disable notifiation on rescan, fix keyerror issue in missing_thumbs build
This commit is contained in:
parent
45d8b7e218
commit
0c3c1b650a
@ -165,11 +165,8 @@ class Reindex:
|
||||
vid_handler.upload_to_es()
|
||||
thumb_handler = ThumbManager()
|
||||
thumb_handler.delete_vid_thumb(youtube_id)
|
||||
to_download = (
|
||||
youtube_id,
|
||||
vid_handler.vid_dict["channel"]["vid_thumb_url"],
|
||||
)
|
||||
thumb_handler.download_vid([to_download])
|
||||
to_download = (youtube_id, vid_handler.vid_dict["vid_thumb_url"])
|
||||
thumb_handler.download_vid([to_download], notify=False)
|
||||
|
||||
@staticmethod
|
||||
def reindex_single_channel(channel_id):
|
||||
|
@ -134,7 +134,7 @@ class ThumbManager:
|
||||
|
||||
return img_raw
|
||||
|
||||
def download_vid(self, missing_thumbs):
|
||||
def download_vid(self, missing_thumbs, notify=True):
|
||||
"""download all missing thumbnails from list"""
|
||||
total = len(missing_thumbs)
|
||||
print(f"downloading {total} thumbnails")
|
||||
@ -158,13 +158,15 @@ class ThumbManager:
|
||||
|
||||
img_raw.convert("RGB").save(thumb_path)
|
||||
|
||||
mess_dict = {
|
||||
"status": "pending",
|
||||
"level": "info",
|
||||
"title": "Adding to download queue.",
|
||||
"message": "Downloading Thumbnails...",
|
||||
}
|
||||
RedisArchivist().set_message("progress:download", mess_dict)
|
||||
if notify:
|
||||
mess_dict = {
|
||||
"status": "pending",
|
||||
"level": "info",
|
||||
"title": "Adding to download queue.",
|
||||
"message": "Downloading Thumbnails...",
|
||||
}
|
||||
RedisArchivist().set_message("progress:download", mess_dict)
|
||||
|
||||
if counter % 50 == 0 and counter != 0:
|
||||
print(f"thumbnail progress: {counter}/{total}")
|
||||
counter = counter + 1
|
||||
|
Loading…
Reference in New Issue
Block a user