mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-19 15:25:51 +00:00
switch deleteQueue to API call
This commit is contained in:
parent
470ecb007d
commit
09556dbf21
@ -4,7 +4,6 @@ Functionality:
|
||||
- called via user input
|
||||
"""
|
||||
|
||||
from home.src.download.queue import PendingInteract
|
||||
from home.src.download.subscriptions import (
|
||||
ChannelSubscription,
|
||||
PlaylistSubscription,
|
||||
@ -62,7 +61,6 @@ class PostData:
|
||||
"show_subed_only": self._show_subed_only,
|
||||
"dlnow": self._dlnow,
|
||||
"show_ignored_only": self._show_ignored_only,
|
||||
"deleteQueue": self._delete_queue,
|
||||
"manual-import": self._manual_import,
|
||||
"re-embed": self._re_embed,
|
||||
"db-backup": self._db_backup,
|
||||
@ -212,13 +210,6 @@ class PostData:
|
||||
RedisArchivist().set_message(key, value)
|
||||
return {"success": True}
|
||||
|
||||
def _delete_queue(self):
|
||||
"""delete download queue"""
|
||||
status = self.exec_val
|
||||
print("deleting from download queue: " + status)
|
||||
PendingInteract(status=status).delete_by_status()
|
||||
return {"success": True}
|
||||
|
||||
@staticmethod
|
||||
def _manual_import():
|
||||
"""run manual import from settings page"""
|
||||
|
@ -204,7 +204,7 @@ function downloadNow(button) {
|
||||
function forgetIgnore(button) {
|
||||
let youtube_id = button.getAttribute('data-id');
|
||||
let apiEndpoint = '/api/download/' + youtube_id + '/';
|
||||
apiRequest(apiEndpoint, "DELETE");
|
||||
apiRequest(apiEndpoint, 'DELETE');
|
||||
document.getElementById('dl-' + youtube_id).remove();
|
||||
}
|
||||
|
||||
@ -220,8 +220,8 @@ function addSingle(button) {
|
||||
|
||||
function deleteQueue(button) {
|
||||
let to_delete = button.getAttribute('data-id');
|
||||
let payload = JSON.stringify({ deleteQueue: to_delete });
|
||||
sendPost(payload);
|
||||
let apiEndpoint = '/api/download/?filter=' + to_delete;
|
||||
apiRequest(apiEndpoint, 'DELETE');
|
||||
// clear button
|
||||
let message = document.createElement('p');
|
||||
message.innerText = 'deleting download queue: ' + to_delete;
|
||||
|
Loading…
Reference in New Issue
Block a user