mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 20:00:15 +00:00
handle running empty dl queue, #55
This commit is contained in:
parent
1a88c85436
commit
de2371c43c
@ -455,6 +455,18 @@ class VideoDownloader:
|
|||||||
"""add pending videos to download queue"""
|
"""add pending videos to download queue"""
|
||||||
all_pending, _ = PendingList().get_all_pending()
|
all_pending, _ = PendingList().get_all_pending()
|
||||||
to_add = [i["youtube_id"] for i in 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 = RedisQueue("dl_queue")
|
||||||
queue.add_list(to_add)
|
queue.add_list(to_add)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user