diff --git a/ydl_server/jobshandler.py b/ydl_server/jobshandler.py index 67dd23b0..0b692a75 100644 --- a/ydl_server/jobshandler.py +++ b/ydl_server/jobshandler.py @@ -32,3 +32,6 @@ def worker(dl_queue): dl_queue.put((Actions.DOWNLOAD, job)) queue.task_done() +def join(): + if thread is not None: + return thread.join() diff --git a/ydl_server/static/js/youtubedl.js b/ydl_server/static/js/youtubedl.js index c9618b15..b51f0c70 100644 --- a/ydl_server/static/js/youtubedl.js +++ b/ydl_server/static/js/youtubedl.js @@ -88,6 +88,19 @@ function get_download_logs(){ }); } +function get_finished_files(){ + $.getJSON("api/finished", function (data) { + let finished_files = ""; + $.each(data.files, function(key, file) { + finished_files += ""; + finished_files += "" + file.name + ""; + finished_files += "" + (new Date(file.modified)).toISOString() + ""; + finished_files += ""; + }); + $("#finished_files").html(finished_files); + }); +} + function hide_logs_detail(){ $('td:nth-child(6),th:nth-child(6)').hide(); } diff --git a/ydl_server/templates/finished.html b/ydl_server/templates/finished.html new file mode 100644 index 00000000..6c0af52b --- /dev/null +++ b/ydl_server/templates/finished.html @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + youtube-dl - done + + + +
+ +
+ +
+
+
+

Finished Files

+ +
+ + + + + + + + + +
NameDate
+
+
+
+ + + + + + + + + + + + diff --git a/ydl_server/templates/index.html b/ydl_server/templates/index.html index 674b986b..fb6a9d62 100644 --- a/ydl_server/templates/index.html +++ b/ydl_server/templates/index.html @@ -26,6 +26,9 @@ +