switch forget ignored to API call

This commit is contained in:
simon 2022-12-22 19:12:09 +07:00
parent db21ee8bcb
commit bad4b48573
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 2 additions and 10 deletions

View File

@ -64,7 +64,6 @@ class PostData:
"show_subed_only": self._show_subed_only,
"dlnow": self._dlnow,
"show_ignored_only": self._show_ignored_only,
"forgetIgnore": self._forget_ignore,
"addSingle": self._add_single,
"deleteQueue": self._delete_queue,
"manual-import": self._manual_import,
@ -226,13 +225,6 @@ class PostData:
RedisArchivist().set_message(key, value)
return {"success": True}
def _forget_ignore(self):
"""delete from ta_download index"""
video_id = self.exec_val
print(f"{video_id}: forget from download")
PendingInteract(video_id=video_id).delete_item()
return {"success": True}
def _add_single(self):
"""add single youtube_id to download queue"""
video_id = self.exec_val

View File

@ -203,8 +203,8 @@ function downloadNow(button) {
function forgetIgnore(button) {
let youtube_id = button.getAttribute('data-id');
let payload = JSON.stringify({ forgetIgnore: youtube_id });
sendPost(payload);
let apiEndpoint = '/api/download/' + youtube_id + '/';
apiRequest(apiEndpoint, "DELETE");
document.getElementById('dl-' + youtube_id).remove();
}