Add Single file archive method.

This commit is contained in:
András Rutkai
2024-03-15 19:41:41 +01:00
parent 5990d4ce2d
commit 5fe6a5b19a
32 changed files with 211 additions and 31 deletions
+5
View File
@@ -7,6 +7,7 @@ import { LinksRouteTo } from "@prisma/client";
import {
pdfAvailable,
readabilityAvailable,
singlefileAvailable,
screenshotAvailable,
} from "../shared/getArchiveValidity";
@@ -27,6 +28,10 @@ export const generateLinkHref = (
if (!readabilityAvailable(link)) return link.url || "";
return `/preserved/${link?.id}?format=${ArchivedFormat.readability}`;
case LinksRouteTo.SINGLEFILE:
if (!singlefileAvailable(link)) return link.url || "";
return `/preserved/${link?.id}?format=${ArchivedFormat.singlefile}`;
case LinksRouteTo.SCREENSHOT:
if (!screenshotAvailable(link)) return link.url || "";