|
@@ -14,7 +14,7 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
import { dirExists, isFileSync, isDir, waittime } from "#utils";
|
|
|
|
|
|
import { saveImgs, calculateMD5 } from "./image.js";
|
|
|
-import { htmlParser } from "./txt.js";
|
|
|
+import { htmlParser, saveMateInfo } from "./txt.js";
|
|
|
import { saveAllCSS } from "./style.js";
|
|
|
|
|
|
const router = express.Router();
|
|
@@ -166,27 +166,12 @@ router.put("/", async function (req, res) {
|
|
|
3、存储html数据
|
|
|
4、存储css数据
|
|
|
*/
|
|
|
+ await saveMateInfo(epub, uploadPath, file_md5, author_id)
|
|
|
await saveImgs(epub, uploadPath, file_md5, author_id);
|
|
|
await saveAllCSS(epub, uploadPath, file_md5, author_id);
|
|
|
// 存储html数据
|
|
|
await htmlParser(epub, zipEpubExtract, file_md5, author_id);
|
|
|
-
|
|
|
- // console.log("\nSPINE:\n");
|
|
|
- // // console.log(epub.flow);
|
|
|
- // epub.flow.forEach((elm) => {
|
|
|
- // if (elm.href.indexOf("html") < 0) {
|
|
|
- // console.log(88, elm);
|
|
|
- // }
|
|
|
- // });
|
|
|
-
|
|
|
- // console.log("\nTOC:\n");
|
|
|
- // console.log(epub.toc);
|
|
|
-
|
|
|
- // epub.toc.forEach((elm) => {
|
|
|
- // if (elm.href.indexOf("html") < 0) {
|
|
|
- // console.log(88, elm);
|
|
|
- // }
|
|
|
- // });
|
|
|
+ console.log('书籍处理完毕')
|
|
|
});
|
|
|
|
|
|
export default router;
|