use monolith instead of singlefile
This commit is contained in:
@@ -102,7 +102,7 @@ export default async function archiveHandler(link: LinksAndCollectionAndOwner) {
|
||||
readable: !link.readable?.startsWith("archive")
|
||||
? "pending"
|
||||
: undefined,
|
||||
singlefile: !link.singlefile?.startsWith("archive")
|
||||
monolith: !link.monolith?.startsWith("archive")
|
||||
? "pending"
|
||||
: undefined,
|
||||
preview: !link.readable?.startsWith("archive")
|
||||
@@ -151,11 +151,11 @@ export default async function archiveHandler(link: LinksAndCollectionAndOwner) {
|
||||
)
|
||||
await handleScreenshotAndPdf(link, page, user);
|
||||
|
||||
// SingleFile
|
||||
// Monolith
|
||||
if (
|
||||
!link.singlefile?.startsWith("archive") &&
|
||||
!link.singlefile?.startsWith("unavailable") &&
|
||||
user.archiveAsSinglefile &&
|
||||
!link.monolith?.startsWith("archive") &&
|
||||
!link.monolith?.startsWith("unavailable") &&
|
||||
user.archiveAsMonolith &&
|
||||
link.url
|
||||
)
|
||||
await handleMonolith(link, content);
|
||||
@@ -183,7 +183,7 @@ export default async function archiveHandler(link: LinksAndCollectionAndOwner) {
|
||||
image: !finalLink.image?.startsWith("archives")
|
||||
? "unavailable"
|
||||
: undefined,
|
||||
singlefile: !finalLink.singlefile?.startsWith("archives")
|
||||
monolith: !finalLink.monolith?.startsWith("archives")
|
||||
? "unavailable"
|
||||
: undefined,
|
||||
pdf: !finalLink.pdf?.startsWith("archives")
|
||||
|
||||
@@ -75,7 +75,7 @@ export default async function getPublicUser(
|
||||
username: lessSensitiveInfo.username,
|
||||
image: lessSensitiveInfo.image,
|
||||
archiveAsScreenshot: lessSensitiveInfo.archiveAsScreenshot,
|
||||
archiveAsSinglefile: lessSensitiveInfo.archiveAsSinglefile,
|
||||
archiveAsMonolith: lessSensitiveInfo.archiveAsMonolith,
|
||||
archiveAsPDF: lessSensitiveInfo.archiveAsPDF,
|
||||
};
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ export default async function updateUserById(
|
||||
),
|
||||
locale: i18n.locales.includes(data.locale) ? data.locale : "en",
|
||||
archiveAsScreenshot: data.archiveAsScreenshot,
|
||||
archiveAsSinglefile: data.archiveAsSinglefile,
|
||||
archiveAsMonolith: data.archiveAsMonolith,
|
||||
archiveAsPDF: data.archiveAsPDF,
|
||||
archiveAsWaybackMachine: data.archiveAsWaybackMachine,
|
||||
linksRouteTo: data.linksRouteTo,
|
||||
|
||||
@@ -19,7 +19,7 @@ const handleMonolith = async (link: Link, content: string) => {
|
||||
);
|
||||
|
||||
if (!html?.length) {
|
||||
console.error("Error running SINGLEFILE_ARCHIVE_COMMAND: Empty buffer");
|
||||
console.error("Error running MONOLITH: Empty buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ const handleMonolith = async (link: Link, content: string) => {
|
||||
await prisma.link.update({
|
||||
where: { id: link.id },
|
||||
data: {
|
||||
singlefile: `archives/${link.collectionId}/${link.id}.html`,
|
||||
monolith: `archives/${link.collectionId}/${link.id}.html`,
|
||||
},
|
||||
});
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("Error running SINGLEFILE_ARCHIVE_COMMAND:", err);
|
||||
console.error("Error running MONOLITH:", err);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user