diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 93cfdb9a7..ea2aa0745 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -780,6 +780,8 @@ def addMediaUrl(request, data): response = json_response(status=403, text='permission denied') else: response = json_response() + i = Item.objects.get(public_id=data['item']) + Tasks.start(i, request.user) t = tasks.download_media.delay(data['item'], data['url']) response['data']['taskId'] = t.task_id add_changelog(request, data, data['item']) diff --git a/pandora/taskqueue/models.py b/pandora/taskqueue/models.py index 3f1810a83..546ccf5f5 100644 --- a/pandora/taskqueue/models.py +++ b/pandora/taskqueue/models.py @@ -91,6 +91,8 @@ class Task(models.Model): status = 'failed' elif self.item.rendered: status = 'finished' + elif not self.item.files.count(): + status = 'queued' else: status = 'unknown' if status != self.status: diff --git a/pandora/taskqueue/views.py b/pandora/taskqueue/views.py index bc55d3ddd..c765f35b8 100644 --- a/pandora/taskqueue/views.py +++ b/pandora/taskqueue/views.py @@ -21,7 +21,7 @@ def getTasks(request, data): [{ started: 0, finished: 0, - status: 'queued|uploading|processing|finished|failed|cancelled', + status: 'pending|uploading|queued|processing|finished|failed|cancelled', title: '', item: 'itemID', id: 'taskID'