Add Single file archive method.
This commit is contained in:
@@ -27,6 +27,7 @@ export default async function Index(req: NextApiRequest, res: NextApiResponse) {
|
||||
else if (format === ArchivedFormat.jpeg) suffix = ".jpeg";
|
||||
else if (format === ArchivedFormat.pdf) suffix = ".pdf";
|
||||
else if (format === ArchivedFormat.readability) suffix = "_readability.json";
|
||||
else if (format === ArchivedFormat.singlefile) suffix = ".html";
|
||||
|
||||
//@ts-ignore
|
||||
if (!linkId || !suffix)
|
||||
|
||||
@@ -76,6 +76,7 @@ const deleteArchivedFiles = async (link: Link & { collection: Collection }) => {
|
||||
image: null,
|
||||
pdf: null,
|
||||
readable: null,
|
||||
singlefile: null,
|
||||
preview: null,
|
||||
},
|
||||
});
|
||||
@@ -89,6 +90,9 @@ const deleteArchivedFiles = async (link: Link & { collection: Collection }) => {
|
||||
await removeFile({
|
||||
filePath: `archives/${link.collection.id}/${link.id}_readability.json`,
|
||||
});
|
||||
await removeFile({
|
||||
filePath: `archives/${link.collection.id}/${link.id}.html`,
|
||||
});
|
||||
await removeFile({
|
||||
filePath: `archives/preview/${link.collection.id}/${link.id}.png`,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user