mirror of
https://github.com/tubearchivist/tubearchivist.git
synced 2024-12-23 10:20:13 +00:00
implement api-stop for download_pending
This commit is contained in:
parent
860213c427
commit
33b9a012d4
@ -174,7 +174,7 @@ class VideoDownloader:
|
||||
|
||||
while True:
|
||||
youtube_data = queue.get_next()
|
||||
if not youtube_data:
|
||||
if self.task.is_stopped() or not youtube_data:
|
||||
break
|
||||
|
||||
youtube_data = json.loads(youtube_data)
|
||||
|
@ -43,7 +43,6 @@ class TaskManager:
|
||||
def is_stopped(self, task_id):
|
||||
"""check if task_id has received STOP command"""
|
||||
task = self.get_task(task_id)
|
||||
print(task)
|
||||
|
||||
return task.get("command") == "STOP"
|
||||
|
||||
|
@ -59,6 +59,7 @@ class BaseTask(Task):
|
||||
"title": "Downloading",
|
||||
"group": "download:run",
|
||||
"api-start": True,
|
||||
"api-stop": True,
|
||||
},
|
||||
"extract_download": {
|
||||
"title": "Add to download queue",
|
||||
|
Loading…
Reference in New Issue
Block a user