mirror of
https://github.com/tubearchivist/tubearchivist.git
synced 2024-12-23 18:30:12 +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:
|
while True:
|
||||||
youtube_data = queue.get_next()
|
youtube_data = queue.get_next()
|
||||||
if not youtube_data:
|
if self.task.is_stopped() or not youtube_data:
|
||||||
break
|
break
|
||||||
|
|
||||||
youtube_data = json.loads(youtube_data)
|
youtube_data = json.loads(youtube_data)
|
||||||
|
@ -43,7 +43,6 @@ class TaskManager:
|
|||||||
def is_stopped(self, task_id):
|
def is_stopped(self, task_id):
|
||||||
"""check if task_id has received STOP command"""
|
"""check if task_id has received STOP command"""
|
||||||
task = self.get_task(task_id)
|
task = self.get_task(task_id)
|
||||||
print(task)
|
|
||||||
|
|
||||||
return task.get("command") == "STOP"
|
return task.get("command") == "STOP"
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ class BaseTask(Task):
|
|||||||
"title": "Downloading",
|
"title": "Downloading",
|
||||||
"group": "download:run",
|
"group": "download:run",
|
||||||
"api-start": True,
|
"api-start": True,
|
||||||
|
"api-stop": True,
|
||||||
},
|
},
|
||||||
"extract_download": {
|
"extract_download": {
|
||||||
"title": "Add to download queue",
|
"title": "Add to download queue",
|
||||||
|
Loading…
Reference in New Issue
Block a user