diff --git a/tubearchivist/home/src/frontend/api_calls.py b/tubearchivist/home/src/frontend/api_calls.py index 47d68b3..4e0a92c 100644 --- a/tubearchivist/home/src/frontend/api_calls.py +++ b/tubearchivist/home/src/frontend/api_calls.py @@ -62,7 +62,6 @@ class PostData: "show_subed_only": self._show_subed_only, "dlnow": self._dlnow, "show_ignored_only": self._show_ignored_only, - "addSingle": self._add_single, "deleteQueue": self._delete_queue, "manual-import": self._manual_import, "re-embed": self._re_embed, @@ -213,13 +212,6 @@ class PostData: RedisArchivist().set_message(key, value) return {"success": True} - def _add_single(self): - """add single youtube_id to download queue""" - video_id = self.exec_val - print(f"{video_id}: add single vid to download queue") - PendingInteract(video_id=video_id, status="pending").update_status() - return {"success": True} - def _delete_queue(self): """delete download queue""" status = self.exec_val diff --git a/tubearchivist/static/script.js b/tubearchivist/static/script.js index edf3de4..4ec6dea 100644 --- a/tubearchivist/static/script.js +++ b/tubearchivist/static/script.js @@ -210,8 +210,8 @@ function forgetIgnore(button) { function addSingle(button) { let youtube_id = button.getAttribute('data-id'); - let payload = JSON.stringify({ addSingle: youtube_id }); - sendPost(payload); + let apiEndpoint = '/api/download/' + youtube_id + '/'; + apiRequest(apiEndpoint, 'POST', {status: 'pending'}) document.getElementById('dl-' + youtube_id).remove(); setTimeout(function () { checkMessages();