diff --git a/tubearchivist/www/src/lib/getDownloads.ts b/tubearchivist/www/src/lib/getDownloads.ts index a786dbd..ef81fa0 100755 --- a/tubearchivist/www/src/lib/getDownloads.ts +++ b/tubearchivist/www/src/lib/getDownloads.ts @@ -65,7 +65,7 @@ export const sendDeleteAllQueuedIgnored = async (token: string, filter: string): method: "DELETE" }); if (!response.ok) { - // throw new Error("Error adding content to the download queue."); + throw new Error("Error removing all videos."); // return response.json(); } return response.json(); @@ -82,7 +82,7 @@ export const sendDeleteVideoQueuedIgnored = async (token: string, videoId: strin method: "DELETE" }); if (!response.ok) { - // throw new Error("Error adding content to the download queue."); + throw new Error("Error removing video."); // return response.json(); } return response.json(); @@ -103,8 +103,7 @@ export const sendMoveVideoQueuedIgnored = async (token: string, videoId: string, method: "POST" }); if (!response.ok) { - // throw new Error("Error adding content to the download queue."); - // return response.json(); + throw new Error("Error moving video to" + status + "."); } 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 dd6307f..2cda7ed 100755 --- a/tubearchivist/www/src/pages/download.tsx +++ b/tubearchivist/www/src/pages/download.tsx @@ -96,6 +96,26 @@ const Download: NextPage = () => { }) .catch(error => handleSetErrorMessage(error.message)); } + const handleMoveVideoQueuedIgnored = (session: string, youtube_id: string, status: string) => { + sendMoveVideoQueuedIgnored(session, youtube_id, status).then(() => { + handleSetErrorMessage(null); + }) + .catch(error => handleSetErrorMessage(error.message)); + } + const handleDeleteVideoQueuedIgnored = (session: string, youtube_id: string) => { + sendDeleteVideoQueuedIgnored(session, youtube_id).then(() => { + handleSetErrorMessage(null); + }) + .catch(error => handleSetErrorMessage(error.message)); + } + + const handleDeleteAllQueuedIgnored = (session: string, filter: string) => { + sendDeleteAllQueuedIgnored(session, filter).then(() => { + handleSetErrorMessage(null); + }) + .catch(error => handleSetErrorMessage(error.message)); + } + return ( <> @@ -255,13 +275,13 @@ const Download: NextPage = () => { {ignoredStatus &&

Ignored from download

- +
} {!ignoredStatus &&

Download queue

- +
}

Total videos: {downloads?.data?.length} {!downloads?.data?.length && !downloads?.message && !ignoredStatus &&

No videos queued for download. Press rescan subscriptions to check if there are any new videos.

}

@@ -293,8 +313,8 @@ const Download: NextPage = () => { {/*

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

*/} {ignoredStatus &&
- - + +
} {/* {% if show_ignored_only %} */} @@ -302,9 +322,9 @@ const Download: NextPage = () => { {/* */} {!ignoredStatus &&
- + - +
} {/* {% else %} */}