🔧 Adding a full extraction endpoint

This commit is contained in:
Rishi Ghan
2022-04-26 14:57:51 -07:00
parent dc4767db27
commit 8c94db1956
3 changed files with 53 additions and 13 deletions

View File

@@ -47,6 +47,7 @@ import {
walkFolder,
getSizeOfDirectory,
} from "../utils/file.utils";
import { uncompressEntireArchive } from "../utils/uncompression.utils";
import { convertXMLToJSON } from "../utils/xml.utils";
import {
IExtractComicBookCoverErrorResponse,
@@ -88,6 +89,13 @@ export default class ImportService extends Service {
return convertXMLToJSON("lagos");
},
},
uncompressFullArchive : {
rest: "POST /uncompressFullArchive",
params: {},
handler: async (ctx: Context<{filePath: string}>) => {
return await uncompressEntireArchive(ctx.params.filePath);
}
},
newImport: {
rest: "POST /newImport",
params: {},
@@ -323,7 +331,7 @@ export default class ImportService extends Service {
) {
return await Comic.paginate(ctx.params.predicate, {
...ctx.params.paginationOptions,
allowDiskUse: true,
// allowDiskUse: true,
});
},
},
@@ -537,7 +545,7 @@ export default class ImportService extends Service {
{ $sort: { count: -1 } },
{ $limit: 1 },
],
mostPopulatCharacter: [],
// mostPopulatCharacter: [],
},
},
]);