Creating Generate Screenshot button for Archives which are missing a screenshot.

This commit is contained in:
Roland 2025-10-19 11:40:02 -06:00 • committed by lrnselfreliance
parent 41e1ed6be6
commit 1ed0d63bac
11 changed files with 508 additions and 4 deletions

View file

@ -750,6 +750,28 @@ export async function getArchive(archiveId) {
}
}
export async function generateArchiveScreenshot(archiveId) {
const response = await apiPost(`${ARCHIVES_API}/${archiveId}/generate_screenshot`);
if (response.ok) {
toast({
type: 'success',
title: 'Screenshot Generation Queued',
description: 'Screenshot generation has been queued. This may take a moment.',
time: 3000,
});
return true;
} else {
const message = await getErrorMessage(response, 'Failed to queue screenshot generation.');
toast({
type: 'error',
title: 'Screenshot Generation Error',
description: message,
time: 5000,
});
return false;
}
}
export async function postDownload(downloadData) {
if (!downloadData.downloader) {
toast({