|
@@ -60,11 +60,14 @@ class DbCreator {
|
|
|
let langArr = [];
|
|
|
|
|
|
//stats
|
|
|
+ let filesCount = 0;
|
|
|
let authorCount = 0;
|
|
|
let bookCount = 0;
|
|
|
let noAuthorBookCount = 0;
|
|
|
let bookDelCount = 0;
|
|
|
|
|
|
+ let filesSet = new Set();
|
|
|
+
|
|
|
//stuff
|
|
|
let recsLoaded = 0;
|
|
|
callback({recsLoaded});
|
|
@@ -145,6 +148,8 @@ class DbCreator {
|
|
|
|
|
|
rec.id = ++id;
|
|
|
|
|
|
+ filesSet.add(`${rec.folder}/${rec.file}.${rec.ext}`);
|
|
|
+
|
|
|
if (!rec.del) {
|
|
|
bookCount++;
|
|
|
if (!rec.author)
|
|
@@ -209,6 +214,9 @@ class DbCreator {
|
|
|
const parser = new InpxParser();
|
|
|
await parser.parse(config.inpxFile, readFileCallback, parsedCallback);
|
|
|
|
|
|
+ filesCount = filesSet.size;
|
|
|
+ filesSet = null;
|
|
|
+
|
|
|
utils.freeMemory();
|
|
|
|
|
|
//отсортируем авторов и выдадим им правильные id
|
|
@@ -447,6 +455,7 @@ class DbCreator {
|
|
|
});
|
|
|
|
|
|
const stats = {
|
|
|
+ filesCount,
|
|
|
recsLoaded,
|
|
|
authorCount,
|
|
|
authorCountAll: authorArr.length,
|