diff --git a/tubearchivist/home/src/reindex.py b/tubearchivist/home/src/reindex.py index 7557e862..faea9d3c 100644 --- a/tubearchivist/home/src/reindex.py +++ b/tubearchivist/home/src/reindex.py @@ -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): diff --git a/tubearchivist/home/src/thumbnails.py b/tubearchivist/home/src/thumbnails.py index 9897276e..5c9e3078 100644 --- a/tubearchivist/home/src/thumbnails.py +++ b/tubearchivist/home/src/thumbnails.py @@ -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