improve link refresh logic + many changes and improvements

This commit is contained in:
daniel31x13
2023-12-19 11:50:43 -05:00
parent 71b99bb25c
commit b65787358f
29 changed files with 297 additions and 1628 deletions
+12 -3
View File
@@ -45,9 +45,18 @@ export default async function archiveHandler(link: LinksAndCollectionAndOwner) {
where: { id: link.id },
data: {
type: linkType,
screenshotPath: user.archiveAsScreenshot ? "pending" : undefined,
pdfPath: user.archiveAsPDF ? "pending" : undefined,
readabilityPath: "pending",
screenshotPath:
user.archiveAsScreenshot &&
!link.screenshotPath?.startsWith("archive")
? "pending"
: undefined,
pdfPath:
user.archiveAsPDF && !link.pdfPath?.startsWith("archive")
? "pending"
: undefined,
readabilityPath: !link.readabilityPath?.startsWith("archive")
? "pending"
: undefined,
lastPreserved: new Date().toISOString(),
},
});
@@ -74,6 +74,8 @@ export default async function getPublicUser(
name: lessSensitiveInfo.name,
username: lessSensitiveInfo.username,
image: lessSensitiveInfo.image,
archiveAsScreenshot: lessSensitiveInfo.archiveAsScreenshot,
archiveAsPdf: lessSensitiveInfo.archiveAsPDF,
};
return { response: data, status: 200 };