bug fix + improvements + bundled up the app

This commit is contained in:
daniel31x13
2023-12-24 06:46:08 -05:00
parent e27fb90f14
commit 86820c402b
10 changed files with 278 additions and 66 deletions
+5 -2
View File
@@ -9,6 +9,7 @@ import { Collection, Link, User } from "@prisma/client";
import validateUrlSize from "./validateUrlSize";
import removeFile from "./storage/removeFile";
import Jimp from "jimp";
import createFolder from "./storage/createFolder";
type LinksAndCollectionAndOwner = Link & {
collection: Collection & {
@@ -123,6 +124,10 @@ export default async function archiveHandler(link: LinksAndCollectionAndOwner) {
return metaTag ? (metaTag as any).content : null;
});
createFolder({
filePath: `archives/preview/${link.collectionId}`,
});
if (ogImageUrl) {
console.log("Found og:image URL:", ogImageUrl);
@@ -161,8 +166,6 @@ export default async function archiveHandler(link: LinksAndCollectionAndOwner) {
} else {
console.log("No image data found.");
}
} else {
console.log("Image response is null.");
}
await page.goBack();
@@ -46,7 +46,7 @@ export default async function getDashboardData(
});
const recentlyAddedLinks = await prisma.link.findMany({
take: 6,
take: 8,
where: {
collection: {
OR: [