archive screenshots as jpeg instead of png + bug fix
This commit is contained in:
parent
8a901ba0e9
commit
06234e42df
|
@ -58,6 +58,7 @@ export default async function deleteCollection(
|
||||||
});
|
});
|
||||||
|
|
||||||
await removeFolder({ filePath: `archives/${collectionId}` });
|
await removeFolder({ filePath: `archives/${collectionId}` });
|
||||||
|
await removeFolder({ filePath: `archives/preview/${collectionId}` });
|
||||||
|
|
||||||
await removeFromOrders(userId, collectionId);
|
await removeFromOrders(userId, collectionId);
|
||||||
|
|
||||||
|
@ -100,6 +101,7 @@ async function deleteSubCollections(collectionId: number) {
|
||||||
});
|
});
|
||||||
|
|
||||||
await removeFolder({ filePath: `archives/${subCollection.id}` });
|
await removeFolder({ filePath: `archives/${subCollection.id}` });
|
||||||
|
await removeFolder({ filePath: `archives/preview/${subCollection.id}` });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ export default async function deleteUserById(
|
||||||
});
|
});
|
||||||
|
|
||||||
// Delete archive folders
|
// Delete archive folders
|
||||||
removeFolder({ filePath: `archives/${collection.id}` });
|
await removeFolder({ filePath: `archives/${collection.id}` });
|
||||||
|
|
||||||
await removeFolder({
|
await removeFolder({
|
||||||
filePath: `archives/preview/${collection.id}`,
|
filePath: `archives/preview/${collection.id}`,
|
||||||
|
|
|
@ -24,10 +24,10 @@ const handleScreenshotAndPdf = async (
|
||||||
|
|
||||||
if (user.archiveAsScreenshot && !link.image?.startsWith("archive")) {
|
if (user.archiveAsScreenshot && !link.image?.startsWith("archive")) {
|
||||||
processingPromises.push(
|
processingPromises.push(
|
||||||
page.screenshot({ fullPage: true, type: "png" }).then((screenshot) => {
|
page.screenshot({ fullPage: true, type: "jpeg" }).then((screenshot) => {
|
||||||
return createFile({
|
return createFile({
|
||||||
data: screenshot,
|
data: screenshot,
|
||||||
filePath: `archives/${linkExists.collectionId}/${link.id}.png`,
|
filePath: `archives/${linkExists.collectionId}/${link.id}.jpeg`,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -60,7 +60,7 @@ const handleScreenshotAndPdf = async (
|
||||||
where: { id: link.id },
|
where: { id: link.id },
|
||||||
data: {
|
data: {
|
||||||
image: user.archiveAsScreenshot
|
image: user.archiveAsScreenshot
|
||||||
? `archives/${linkExists.collectionId}/${link.id}.png`
|
? `archives/${linkExists.collectionId}/${link.id}.jpeg`
|
||||||
: undefined,
|
: undefined,
|
||||||
pdf: user.archiveAsPDF
|
pdf: user.archiveAsPDF
|
||||||
? `archives/${linkExists.collectionId}/${link.id}.pdf`
|
? `archives/${linkExists.collectionId}/${link.id}.pdf`
|
||||||
|
|
Ŝarĝante…
Reference in New Issue