improve link refresh logic + many changes and improvements
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user