mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-04 19:30:13 +00:00
fix blocking issue where download_now wouldn't delay
This commit is contained in:
parent
46487d682e
commit
3d2d11ba3a
@ -55,8 +55,7 @@ def download_pending():
|
|||||||
@shared_task
|
@shared_task
|
||||||
def download_single(youtube_id):
|
def download_single(youtube_id):
|
||||||
""" start download single video now """
|
""" start download single video now """
|
||||||
to_download = [youtube_id]
|
download_handler = VideoDownloader([youtube_id])
|
||||||
download_handler = VideoDownloader(to_download)
|
|
||||||
download_handler.download_list()
|
download_handler.download_list()
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<p>Published: {{ video.published }} | Duration: {{ video.duration }} | {{ video.youtube_id }}</p>
|
<p>Published: {{ video.published }} | Duration: {{ video.duration }} | {{ video.youtube_id }}</p>
|
||||||
<button data-id="{{ video.youtube_id }}" onclick="toIgnore(this)">Ignore</button>
|
<button data-id="{{ video.youtube_id }}" onclick="toIgnore(this)">Ignore</button>
|
||||||
<button data-id="{{ video.youtube_id }}" onclick="downloadNow(this)">Download now</button>
|
<button id="{{ video.youtube_id }}" data-id="{{ video.youtube_id }}" onclick="downloadNow(this)">Download now</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -542,7 +542,7 @@ class PostData:
|
|||||||
elif task == 'dlnow':
|
elif task == 'dlnow':
|
||||||
youtube_id = item['status']
|
youtube_id = item['status']
|
||||||
print('downloading: ' + youtube_id)
|
print('downloading: ' + youtube_id)
|
||||||
download_single(youtube_id)
|
download_single.delay(youtube_id=youtube_id)
|
||||||
elif task == 'manual-import':
|
elif task == 'manual-import':
|
||||||
print('starting manual import')
|
print('starting manual import')
|
||||||
run_manual_import.delay()
|
run_manual_import.delay()
|
||||||
|
@ -72,8 +72,8 @@ function toIgnore(button) {
|
|||||||
function downloadNow(button) {
|
function downloadNow(button) {
|
||||||
var youtube_id = button.getAttribute('data-id');
|
var youtube_id = button.getAttribute('data-id');
|
||||||
var payload = JSON.stringify({'dlnow': youtube_id});
|
var payload = JSON.stringify({'dlnow': youtube_id});
|
||||||
animate('download-icon', 'bounce-img');
|
|
||||||
sendPost(payload);
|
sendPost(payload);
|
||||||
|
document.getElementById(youtube_id).remove();
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
handleInterval();
|
handleInterval();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
Loading…
Reference in New Issue
Block a user