diff --git a/tubearchivist/www/src/lib/getDownloads.ts b/tubearchivist/www/src/lib/getDownloads.ts index 28770c9..b714a92 100755 --- a/tubearchivist/www/src/lib/getDownloads.ts +++ b/tubearchivist/www/src/lib/getDownloads.ts @@ -57,4 +57,21 @@ export const sendDeleteAllQueuedIgnored = async (token: string, filter: string): // return response.json(); } return response.json(); +}; + +export const sendDeleteVideoQueuedIgnored = async (token: string, videoId: string): Promise => { + const response = await fetch(`${TA_BASE_URL.server}/api/download/${videoId}/`, { + headers: { + Accept: "application/json", + "Content-Type": "application/json", + Authorization: `Token ${token}`, + mode: "no-cors", + }, + method: "DELETE" + }); + if (!response.ok) { + // throw new Error("Error adding content to the download queue."); + // return response.json(); + } + return response.json(); }; \ No newline at end of file diff --git a/tubearchivist/www/src/pages/download.tsx b/tubearchivist/www/src/pages/download.tsx index c19da13..b151140 100755 --- a/tubearchivist/www/src/pages/download.tsx +++ b/tubearchivist/www/src/pages/download.tsx @@ -5,7 +5,7 @@ import { dehydrate, QueryClient, useQuery } from "react-query"; import { CustomHead } from "../components/CustomHead"; import { Layout } from "../components/Layout"; import NextImage from "next/image"; -import { getDownloads, sendDeleteAllQueuedIgnored } from "../lib/getDownloads"; +import { getDownloads, sendDeleteAllQueuedIgnored, sendDeleteVideoQueuedIgnored } from "../lib/getDownloads"; import { sendDownloads } from "../lib/getDownloads"; import RescanIcon from "../images/icon-rescan.svg"; import DownloadIcon from "../images/icon-download.svg"; @@ -237,8 +237,8 @@ const Download: NextPage = () => { {/*

Published: {{ video.source.published }} | Duration: {{ video.source.duration }} | {{ video.source.youtube_id }}

*/} {ignoredStatus &&
- +
} {/* {% if show_ignored_only %} */} @@ -248,6 +248,7 @@ const Download: NextPage = () => {
+
} {/* {% else %} */}