Skip to content

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

Merge branch 'dev' into dev

Daniela20c4a67a8c9
diff --cc apps/worker/lib/preservationScheme/handleArchivePreview.ts
index 058a8af6,772cfb52..bfb76ea9
--- a/apps/worker/lib/preservationScheme/handleArchivePreview.ts
+++ b/apps/worker/lib/preservationScheme/handleArchivePreview.ts
@@@ -19,18 -19,20 +19,23 @@@ const handleArchivePreview = async
return metaTag ? (metaTag as any).content : null;
});
+ let previewGenerated = false;
-
++
if (ogImageUrl) {
- console.log("Found og:image URL:", ogImageUrl);
+ if (!ogImageUrl.startsWith("http://") && !ogImageUrl.startsWith("https://")) {
+ const origin = await page.evaluate(() => document.location.origin);
+ ogImageUrl = origin + (ogImageUrl.startsWith("/") ? ogImageUrl : ("/" + ogImageUrl));
+ }
+
- // Download the image
const imageResponse = await page.goto(ogImageUrl);
- // Check if imageResponse is not null
if (imageResponse && !link.preview?.startsWith("archive")) {
const buffer = await imageResponse.body();
- generatePreview(buffer, link.collectionId, link.id);
+ previewGenerated = await generatePreview(
+ buffer,
+ link.collectionId,
+ link.id
+ );
}
await page.goBack();