- {temp.file_url ? (
+ {(temp.preview_url ?? temp.file_url) ? (
isVideo ? (
) : (

@@ -715,6 +716,15 @@ export default function UploadPage() {
);
}
+ function dismissAll(items: TempUpload[]) {
+ if (items.length === 0) return;
+ void Promise.allSettled(
+ items.map((temp) =>
+ api(`/api/uploads/${temp.temp_id}/`, { method: "DELETE" }),
+ ),
+ ).then(() => invalidateUploads());
+ }
+
function clearFinished() {
setEntries((current) => current.filter((entry) => entry.status !== "done"));
}
@@ -737,12 +747,16 @@ export default function UploadPage() {
title: string,
items: TempUpload[],
emptyText: string,
+ action?: ReactNode,
) => (
{title}
-
- {items.length}
+
+ {action}
+
+ {items.length}
+
{items.length === 0 ? (
@@ -888,7 +902,21 @@ export default function UploadPage() {
visual,
"No IQDB matches right now.",
)}
- {column("Auto-uploaded & Indexed", completed, "Nothing indexed yet.")}
+ {column(
+ "Auto-uploaded & Indexed",
+ completed,
+ "Nothing indexed yet.",
+ completed.length > 0 ? (
+
+ ) : null,
+ )}
{modalFor ? (
diff --git a/frontend/src/lib/types.ts b/frontend/src/lib/types.ts
index 30813ec..e4bec13 100644
--- a/frontend/src/lib/types.ts
+++ b/frontend/src/lib/types.ts
@@ -135,6 +135,7 @@ export interface TempUpload {
iqdb_data: E621IqdbCandidate[] | null;
library_j_id: string | null;
file_url: string | null;
+ preview_url: string | null;
created_at: string;
updated_at: string;
}