👷🏽 Workerizing the import algorithm

This commit is contained in:
2021-04-23 13:18:18 -07:00
parent ecc05b09de
commit a1418c55c4
3 changed files with 9 additions and 17 deletions

View File

@@ -1,10 +1,8 @@
import * as Comlink from "comlink";
import { extractCoverFromComicBookArchive } from "../shared/utils/folder.utils";
import { walkFolder } from "../actions/fileops.actions";
import { IExtractionOptions } from "../../server/interfaces/folder.interface";
function add(a, b) {
return a + b;
}
function importComicBooks() {
async function importComicBooks() {
// 1. Walk the folder structure
// 2. Scan for .cbz, .cbr
// 3. extract cover image
@@ -12,10 +10,12 @@ function importComicBooks() {
// 5. Get metadata, add to data model
// 5. Save cover to disk
// 6. Save model to mongo
const fileObjects = await walkFolder("./comics");
}
Comlink.expose({
add,
importComicBooks,
});
export default null as any;