From fba127f7cac4175a457712c454c6c2a3b90ac447 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 19 Oct 2022 16:04:41 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=81=D1=82=D0=B0=D1=82=D0=B8=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BF=D0=BE=20=D0=BA=D0=BE=D0=BB=D0=B8=D1=87?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D0=B2=D1=83=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=BA=D0=BD=D0=B8=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Search/Search.vue | 2 ++ server/core/DbCreator.js | 9 +++++++++ server/core/InpxHashCreator.js | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index fd41915..8cdd35b 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -679,6 +679,8 @@ class Search { info += `
`; info += ` +
Всего файлов книг:
${stat.filesCount}
+
Обработано ссылок на книги:
${stat.bookCountAll}
Из них актуальных:
${stat.bookCount}
Помеченных как удаленные:
${stat.bookDelCount}
diff --git a/server/core/DbCreator.js b/server/core/DbCreator.js index 9b74a11..b4f41da 100644 --- a/server/core/DbCreator.js +++ b/server/core/DbCreator.js @@ -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, diff --git a/server/core/InpxHashCreator.js b/server/core/InpxHashCreator.js index 35460da..0248615 100644 --- a/server/core/InpxHashCreator.js +++ b/server/core/InpxHashCreator.js @@ -4,7 +4,7 @@ const utils = require('./utils'); //поправить в случае, если были критические изменения в DbCreator //иначе будет рассинхронизация между сервером и клиентом на уровне БД -const dbCreatorVersion = '2'; +const dbCreatorVersion = '3'; class InpxHashCreator { constructor(config) {