Adding selection to the Downloads page, user can delete or retry multiple downloads at once.

This commit is contained in:
Roland 2025-12-26 10:16:12 -07:00
parent d4f1cfb859
commit 6a9ffcaadc
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
8 changed files with 706 additions and 187 deletions

View file

@ -1284,6 +1284,33 @@ export async function retryOnceDownloads() {
return response
}
export async function batchDeleteDownloads(downloadIds) {
const response = await apiPost(`${API_URI}/download/batch/delete`, {download_ids: downloadIds});
if (!response.ok) {
const message = await getErrorMessage(response, 'Could not delete downloads! See server logs.');
toast({type: 'error', title: 'Downloads Error', description: message, time: 5000});
}
return response
}
export async function batchRetryDownloads(downloadIds) {
const response = await apiPost(`${API_URI}/download/batch/retry`, {download_ids: downloadIds});
if (!response.ok) {
const message = await getErrorMessage(response, 'Could not retry downloads! See server logs.');
toast({type: 'error', title: 'Downloads Error', description: message, time: 5000});
}
return response
}
export async function batchClearDownloads(downloadIds) {
const response = await apiPost(`${API_URI}/download/batch/clear`, {download_ids: downloadIds});
if (!response.ok) {
const message = await getErrorMessage(response, 'Could not clear downloads! See server logs.');
toast({type: 'error', title: 'Downloads Error', description: message, time: 5000});
}
return response
}
export async function getStatistics() {
const response = await apiGet(`${API_URI}/statistics`);
if (response.ok) {