Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

archive screenshots as jpeg instead of png + bug fix

daniel31x1306234e42dfe2
diff --git a/lib/api/controllers/collections/collectionId/deleteCollectionById.ts b/lib/api/controllers/collections/collectionId/deleteCollectionById.ts
index 1ac1bf65..1e21809e 100644
--- a/lib/api/controllers/collections/collectionId/deleteCollectionById.ts
+++ b/lib/api/controllers/collections/collectionId/deleteCollectionById.ts
@@ -58,6 +58,7 @@ export default async function deleteCollection(
});
await removeFolder({ filePath: `archives/${collectionId}` });
+ await removeFolder({ filePath: `archives/preview/${collectionId}` });
await removeFromOrders(userId, collectionId);
@@ -100,6 +101,7 @@ async function deleteSubCollections(collectionId: number) {
});
await removeFolder({ filePath: `archives/${subCollection.id}` });
+ await removeFolder({ filePath: `archives/preview/${subCollection.id}` });
}
}
diff --git a/lib/api/controllers/users/userId/deleteUserById.ts b/lib/api/controllers/users/userId/deleteUserById.ts
index 9b65304b..a6e61064 100644
--- a/lib/api/controllers/users/userId/deleteUserById.ts
+++ b/lib/api/controllers/users/userId/deleteUserById.ts
@@ -80,7 +80,7 @@ export default async function deleteUserById(
});
// Delete archive folders
- removeFolder({ filePath: `archives/${collection.id}` });
+ await removeFolder({ filePath: `archives/${collection.id}` });
await removeFolder({
filePath: `archives/preview/${collection.id}`,
diff --git a/lib/api/preservationScheme/handleScreenshotAndPdf.ts b/lib/api/preservationScheme/handleScreenshotAndPdf.ts
index e6e1baca..bc6922b0 100644
--- a/lib/api/preservationScheme/handleScreenshotAndPdf.ts
+++ b/lib/api/preservationScheme/handleScreenshotAndPdf.ts
@@ -24,10 +24,10 @@ const handleScreenshotAndPdf = async (
if (user.archiveAsScreenshot && !link.image?.startsWith("archive")) {
processingPromises.push(
- page.screenshot({ fullPage: true, type: "png" }).then((screenshot) => {
+ page.screenshot({ fullPage: true, type: "jpeg" }).then((screenshot) => {
return createFile({
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 },
data: {
image: user.archiveAsScreenshot
- ? `archives/${linkExists.collectionId}/${link.id}.png`
+ ? `archives/${linkExists.collectionId}/${link.id}.jpeg`
: undefined,
pdf: user.archiveAsPDF
? `archives/${linkExists.collectionId}/${link.id}.pdf`