Добавлена статистика по количеству файлов книг
This commit is contained in:
@@ -679,6 +679,8 @@ class Search {
|
||||
info += `<div style="min-width: 250px" />`;
|
||||
|
||||
info += `
|
||||
<div><div ${keyStyle}>Всего файлов книг:</div><span>${stat.filesCount}</span></div>
|
||||
<br>
|
||||
<div><div ${keyStyle}>Обработано ссылок на книги:</div><span>${stat.bookCountAll}</span></div>
|
||||
<div><div ${keyStyle}>Из них актуальных:</div><span>${stat.bookCount}</span></div>
|
||||
<div><div ${keyStyle}>Помеченных как удаленные:</div><span>${stat.bookDelCount}</span></div>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -4,7 +4,7 @@ const utils = require('./utils');
|
||||
|
||||
//поправить в случае, если были критические изменения в DbCreator
|
||||
//иначе будет рассинхронизация между сервером и клиентом на уровне БД
|
||||
const dbCreatorVersion = '2';
|
||||
const dbCreatorVersion = '3';
|
||||
|
||||
class InpxHashCreator {
|
||||
constructor(config) {
|
||||
|
||||
Reference in New Issue
Block a user