handle running empty dl queue, #55

This commit is contained in:
simon 2021-10-17 11:28:05 +07:00
parent 1a88c85436
commit de2371c43c

View File

@ -455,6 +455,18 @@ class VideoDownloader:
"""add pending videos to download queue"""
all_pending, _ = PendingList().get_all_pending()
to_add = [i["youtube_id"] for i in all_pending]
if not to_add:
# there is nothing pending
print("download queue is empty")
mess_dict = {
"status": "downloading",
"level": "error",
"title": "Download queue is empty",
"message": "",
}
RedisArchivist().set_message("progress:download", mess_dict)
return
queue = RedisQueue("dl_queue")
queue.add_list(to_add)