mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-12-22 18:00:17 +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
|
||||
def download_single(youtube_id):
|
||||
""" start download single video now """
|
||||
to_download = [youtube_id]
|
||||
download_handler = VideoDownloader(to_download)
|
||||
download_handler = VideoDownloader([youtube_id])
|
||||
download_handler.download_list()
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
||||
{% endif %}
|
||||
<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="downloadNow(this)">Download now</button>
|
||||
<button id="{{ video.youtube_id }}" data-id="{{ video.youtube_id }}" onclick="downloadNow(this)">Download now</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
@ -542,7 +542,7 @@ class PostData:
|
||||
elif task == 'dlnow':
|
||||
youtube_id = item['status']
|
||||
print('downloading: ' + youtube_id)
|
||||
download_single(youtube_id)
|
||||
download_single.delay(youtube_id=youtube_id)
|
||||
elif task == 'manual-import':
|
||||
print('starting manual import')
|
||||
run_manual_import.delay()
|
||||
|
@ -72,8 +72,8 @@ function toIgnore(button) {
|
||||
function downloadNow(button) {
|
||||
var youtube_id = button.getAttribute('data-id');
|
||||
var payload = JSON.stringify({'dlnow': youtube_id});
|
||||
animate('download-icon', 'bounce-img');
|
||||
sendPost(payload);
|
||||
document.getElementById(youtube_id).remove();
|
||||
setTimeout(function(){
|
||||
handleInterval();
|
||||
}, 500);
|
||||
|
Loading…
Reference in New Issue
Block a user