From c17b696d618b98199ccc1c1a5e172440ccd22722 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 9 Dec 2022 16:40:30 +0700 Subject: [PATCH 01/12] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B3=D1=83=D0=BB=D1=8F=D1=80=D0=BD=D1=8B=D0=BC=20?= =?UTF-8?q?=D0=B2=D1=8B=D1=80=D0=B0=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Search/BaseList.js | 9 +++++- client/components/Search/Search.vue | 5 ++++ .../SelectExtSearchDialog.vue | 3 ++ server/core/DbSearcher.js | 29 +++++++++++++++---- server/core/opds/BasePage.js | 9 +++++- server/core/opds/SearchHelpPage.js | 3 ++ 6 files changed, 51 insertions(+), 7 deletions(-) diff --git a/client/components/Search/BaseList.js b/client/components/Search/BaseList.js index dee8119..0a8113f 100644 --- a/client/components/Search/BaseList.js +++ b/client/components/Search/BaseList.js @@ -385,7 +385,14 @@ export default class BaseList { } else if (searchValue[0] == '#') { searchValue = searchValue.substring(1); - return !bookValue || (bookValue !== emptyFieldValue && !enru.has(bookValue[0]) && bookValue.indexOf(searchValue) >= 0); + if (!bookValue) + return false; + return bookValue !== emptyFieldValue && !enru.has(bookValue[0]) && bookValue.indexOf(searchValue) >= 0; + } else if (searchValue[0] == '~') {//RegExp + + searchValue = searchValue.substring(1); + const re = new RegExp(searchValue, 'gi'); + return re.exec(bookValue); } else { //where = `@dirtyIndexLR('value', ${db.esc(a)}, ${db.esc(a + maxUtf8Char)})`; return bookValue.localeCompare(searchValue) >= 0 && bookValue.localeCompare(searchValue + maxUtf8Char) <= 0; diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index 05309bc..c0b563e 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -789,6 +789,11 @@ class Search { Указание простого "#" в поиске по названию означает: найти всех авторов, названия книг которых начинаются не с русской или латинской буквы
+
  • + "~" поиск по регулярному выражению. Например, для "~^\\s" в поле названия, будут найдены + все книги, названия которых начинаются с пробельного символа +
  • +
  • "?" поиск пустых значений или тех, что начинаются с этого символа. Например, "?" в поле серии означает: найти всех авторов, у которых есть книги без серий или название серии начинается с "?". diff --git a/client/components/Search/SelectExtSearchDialog/SelectExtSearchDialog.vue b/client/components/Search/SelectExtSearchDialog/SelectExtSearchDialog.vue index b4fe73d..197a9db 100644 --- a/client/components/Search/SelectExtSearchDialog/SelectExtSearchDialog.vue +++ b/client/components/Search/SelectExtSearchDialog/SelectExtSearchDialog.vue @@ -160,6 +160,9 @@ class SelectExtSearchDialog {
  • префикс "#": поиск подстроки в строке, но только среди начинающихся не с латинского или кириллического символа
  • +
  • + префикс "~": поиск по регулярному выражению +
  • префикс "?": поиск пустых значений или тех, что начинаются с этого символа
  • diff --git a/server/core/DbSearcher.js b/server/core/DbSearcher.js index 49c7b48..69697a4 100644 --- a/server/core/DbSearcher.js +++ b/server/core/DbSearcher.js @@ -63,8 +63,18 @@ class DbSearcher { a = a.substring(1); where = `@indexIter('value', (v) => { const enru = new Set(${db.esc(enruArr)}); - return !v || (v !== ${db.esc(emptyFieldValue)} && !enru.has(v[0]) && v.indexOf(${db.esc(a)}) >= 0); + if (!v) + return false; + return v !== ${db.esc(emptyFieldValue)} && !enru.has(v[0]) && v.indexOf(${db.esc(a)}) >= 0; })`; + } else if (a[0] == '~') {//RegExp + a = a.substring(1); + where = ` + await (async() => { + const re = new RegExp(${db.esc(a)}, 'gi'); + @@indexIter('value', (v) => re.exec(v) ); + })() + `; } else { where = `@dirtyIndexLR('value', ${db.esc(a)}, ${db.esc(a + maxUtf8Char)})`; } @@ -99,7 +109,7 @@ class DbSearcher { }; //авторы - if (query.author && query.author !== '*') { + if (query.author) { const key = `book-ids-author-${query.author}`; let ids = await this.getCached(key); @@ -113,7 +123,7 @@ class DbSearcher { } //серии - if (query.series && query.series !== '*') { + if (query.series) { const key = `book-ids-series-${query.series}`; let ids = await this.getCached(key); @@ -127,7 +137,7 @@ class DbSearcher { } //названия - if (query.title && query.title !== '*') { + if (query.title) { const key = `book-ids-title-${query.title}`; let ids = await this.getCached(key); @@ -337,7 +347,7 @@ class DbSearcher { //то в выборку по bookId могут попасть авторы, которые отсутствуют в критерии query.author, //поэтому дополнительно фильтруем let result = null; - if (from == 'author' && query.author && query.author !== '*') { + if (from == 'author' && query.author) { const key = `filter-ids-author-${query.author}`; let authorIds = await this.getCached(key); @@ -562,6 +572,15 @@ class DbSearcher { searchValue = searchValue.substring(1); return `(row.${bookField} === '' || (!enru.has(row.${bookField}.toLowerCase()[0]) && row.${bookField}.toLowerCase().indexOf(${db.esc(searchValue)}) >= 0))`; + } else if (searchValue[0] == '~') {//RegExp + searchValue = searchValue.substring(1); + + return ` + (() => { + const re = new RegExp(${db.esc(searchValue)}, 'gi'); + return re.exec(row.${bookField}); + })() + `; } else { return `(row.${bookField}.toLowerCase().localeCompare(${db.esc(searchValue)}) >= 0 ` + diff --git a/server/core/opds/BasePage.js b/server/core/opds/BasePage.js index ccfc4dc..fba01bb 100644 --- a/server/core/opds/BasePage.js +++ b/server/core/opds/BasePage.js @@ -250,7 +250,14 @@ class BasePage { } else if (searchValue[0] == '#') { searchValue = searchValue.substring(1); - return !bookValue || (bookValue !== emptyFieldValue && !enru.has(bookValue[0]) && bookValue.indexOf(searchValue) >= 0); + if (!bookValue) + return false; + return bookValue !== emptyFieldValue && !enru.has(bookValue[0]) && bookValue.indexOf(searchValue) >= 0; + } else if (searchValue[0] == '~') {//RegExp + + searchValue = searchValue.substring(1); + const re = new RegExp(searchValue, 'gi'); + return re.exec(bookValue); } else { //where = `@dirtyIndexLR('value', ${db.esc(a)}, ${db.esc(a + maxUtf8Char)})`; return bookValue.localeCompare(searchValue) >= 0 && bookValue.localeCompare(searchValue + maxUtf8Char) <= 0; diff --git a/server/core/opds/SearchHelpPage.js b/server/core/opds/SearchHelpPage.js index 5c71751..60c084a 100644 --- a/server/core/opds/SearchHelpPage.js +++ b/server/core/opds/SearchHelpPage.js @@ -31,6 +31,9 @@ class SearchHelpPage extends BasePage {
  • префикс "#": поиск подстроки в строке, но только среди значений, начинающихся не с латинского или кириллического символа
  • +
  • + префикс "~": поиск по регулярному выражению +
  • префикс "?": поиск пустых значений или тех, что начинаются с этого символа
  • From 48b973d384bb87e829715e2f8178ff3892f4a93f Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 9 Dec 2022 16:49:47 +0700 Subject: [PATCH 02/12] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/opds/SearchPage.js | 64 ++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/server/core/opds/SearchPage.js b/server/core/opds/SearchPage.js index 93f3616..42026ec 100644 --- a/server/core/opds/SearchPage.js +++ b/server/core/opds/SearchPage.js @@ -21,40 +21,50 @@ class SearchPage extends BasePage { let entry = []; if (query.type) { if (['author', 'series', 'title'].includes(query.type)) { - const from = query.type; - const page = query.page; + try { + const from = query.type; + const page = query.page; - const limit = 100; - const offset = (page - 1)*limit; - const queryRes = await this.webWorker.search(from, {[from]: query.term, del: 0, offset, limit}); + const limit = 100; + const offset = (page - 1)*limit; + const queryRes = await this.webWorker.search(from, {[from]: query.term, del: 0, offset, limit}); - const found = queryRes.found; + const found = queryRes.found; - for (let i = 0; i < found.length; i++) { - const row = found[i]; - if (!row.bookCount) - continue; + for (let i = 0; i < found.length; i++) { + const row = found[i]; + if (!row.bookCount) + continue; - entry.push( - this.makeEntry({ - id: row.id, - title: `${(from === 'series' ? 'Серия: ': '')}${from === 'author' ? this.bookAuthor(row[from]) : row[from]}`, - link: this.navLink({href: `/${from}?${from}==${encodeURIComponent(row[from])}`}), - content: { - '*ATTRS': {type: 'text'}, - '*TEXT': `${row.bookCount} книг${utils.wordEnding(row.bookCount, 8)}`, - }, - }), - ); - } + entry.push( + this.makeEntry({ + id: row.id, + title: `${(from === 'series' ? 'Серия: ': '')}${from === 'author' ? this.bookAuthor(row[from]) : row[from]}`, + link: this.navLink({href: `/${from}?${from}==${encodeURIComponent(row[from])}`}), + content: { + '*ATTRS': {type: 'text'}, + '*TEXT': `${row.bookCount} книг${utils.wordEnding(row.bookCount, 8)}`, + }, + }), + ); + } - if (queryRes.totalFound > offset + found.length) { + if (queryRes.totalFound > offset + found.length) { + entry.push( + this.makeEntry({ + id: 'next_page', + title: '[Следующая страница]', + link: this.navLink({href: `/${this.id}?type=${from}&term=${encodeURIComponent(query.term)}&page=${page + 1}`}), + }) + ); + } + } catch(e) { entry.push( this.makeEntry({ - id: 'next_page', - title: '[Следующая страница]', - link: this.navLink({href: `/${this.id}?type=${from}&term=${encodeURIComponent(query.term)}&page=${page + 1}`}), - }), + id: 'error', + title: `Ошибка: ${e.message}`, + link: this.navLink({href: `/fake-error-link`}), + }) ); } } From 64254ccf5fa33b109aa35d77a8d2b44fd3b8c6d9 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 9 Dec 2022 16:50:57 +0700 Subject: [PATCH 03/12] CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b98d93c..35bc5c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ +1.5.0 / 2022-12-?? +------------------ + +- Добавлена возможность поиска по регулярному выражению (префикс "~") + 1.4.0 / 2022-12-07 ------------------ + - Добавлена возможность расширенного поиска (раздел ""). Поиск не оптимизирован и может сильно нагружать сервер. Отключить можно в конфиге, параметр extendedSearch - Улучшение поддержки reverse-proxy, в конфиг добавлены параметры server.root и opds.root для встраивания inpx-web в уже существующий веб-сервер From 85bf7296efe9ce0f3a5ee442f7dea6076099cd83 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 9 Dec 2022 17:48:40 +0700 Subject: [PATCH 04/12] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=84=D0=BE=D1=80=D0=BC=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2=D0=BE=D0=B9=20=D0=91=D0=94=20(=D0=B8=D0=B7=20series=20?= =?UTF-8?q?=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=B8=D0=BD=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BE=20=D0=BA?= =?UTF-8?q?=D0=BD=D0=B8=D0=B3=D0=B0=D1=85=20=D0=B1=D0=B5=D0=B7=20=D1=81?= =?UTF-8?q?=D0=B5=D1=80=D0=B8=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/config/base.js | 2 +- server/core/DbCreator.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/server/config/base.js b/server/config/base.js index 45e882f..591f0a8 100644 --- a/server/config/base.js +++ b/server/config/base.js @@ -18,7 +18,7 @@ module.exports = { //поправить в случае, если были критические изменения в DbCreator или InpxParser //иначе будет рассинхронизация между сервером и клиентом на уровне БД - dbVersion: '10', + dbVersion: '11', dbCacheSize: 5, maxPayloadSize: 500,//in MB diff --git a/server/core/DbCreator.js b/server/core/DbCreator.js index 0ed0cc3..4066ff7 100644 --- a/server/core/DbCreator.js +++ b/server/core/DbCreator.js @@ -337,7 +337,7 @@ class DbCreator { //сохраним поисковые таблицы const chunkSize = 10000; - const saveTable = async(table, arr, nullArr, indexType = 'string') => { + const saveTable = async(table, arr, nullArr, indexType = 'string', delEmpty = false) => { if (indexType == 'string') arr.sort((a, b) => a.value.localeCompare(b.value)); @@ -366,6 +366,13 @@ class DbCreator { callback({progress: i/arr.length}); } + if (delEmpty) { + const delResult = await db.delete({table, where: `@@indexLR('value', '?', '?')`}); + const statField = `${table}Count`; + if (stats[statField]) + stats[statField] -= delResult.deleted; + } + nullArr(); await db.close({table}); utils.freeMemory(); @@ -378,7 +385,7 @@ class DbCreator { //series callback({job: 'series save', jobMessage: 'Сохранение индекса серий', jobStep: 4, progress: 0}); - await saveTable('series', seriesArr, () => {seriesArr = null}); + await saveTable('series', seriesArr, () => {seriesArr = null}, 'string', true); //title callback({job: 'title save', jobMessage: 'Сохранение индекса названий', jobStep: 5, progress: 0}); From bd2551559b23d779af17730585ae1bd92617d830 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 9 Dec 2022 18:31:41 +0700 Subject: [PATCH 05/12] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B1=D0=B0=D0=B3=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=D0=B0=20=D0=BF=D0=BE=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B3.=20=D0=B2=D1=8B=D1=80=D0=B0=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Search/BaseList.js | 4 ++-- server/core/DbSearcher.js | 8 ++++---- server/core/opds/BasePage.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/components/Search/BaseList.js b/client/components/Search/BaseList.js index 0a8113f..ddc7b9d 100644 --- a/client/components/Search/BaseList.js +++ b/client/components/Search/BaseList.js @@ -391,8 +391,8 @@ export default class BaseList { } else if (searchValue[0] == '~') {//RegExp searchValue = searchValue.substring(1); - const re = new RegExp(searchValue, 'gi'); - return re.exec(bookValue); + const re = new RegExp(searchValue, 'i'); + return re.test(bookValue); } else { //where = `@dirtyIndexLR('value', ${db.esc(a)}, ${db.esc(a + maxUtf8Char)})`; return bookValue.localeCompare(searchValue) >= 0 && bookValue.localeCompare(searchValue + maxUtf8Char) <= 0; diff --git a/server/core/DbSearcher.js b/server/core/DbSearcher.js index 69697a4..79cceb2 100644 --- a/server/core/DbSearcher.js +++ b/server/core/DbSearcher.js @@ -71,8 +71,8 @@ class DbSearcher { a = a.substring(1); where = ` await (async() => { - const re = new RegExp(${db.esc(a)}, 'gi'); - @@indexIter('value', (v) => re.exec(v) ); + const re = new RegExp(${db.esc(a)}, 'i'); + @@indexIter('value', (v) => re.test(v) ); })() `; } else { @@ -577,8 +577,8 @@ class DbSearcher { return ` (() => { - const re = new RegExp(${db.esc(searchValue)}, 'gi'); - return re.exec(row.${bookField}); + const re = new RegExp(${db.esc(searchValue)}, 'i'); + return re.test(row.${bookField}); })() `; } else { diff --git a/server/core/opds/BasePage.js b/server/core/opds/BasePage.js index fba01bb..fd5abe4 100644 --- a/server/core/opds/BasePage.js +++ b/server/core/opds/BasePage.js @@ -256,8 +256,8 @@ class BasePage { } else if (searchValue[0] == '~') {//RegExp searchValue = searchValue.substring(1); - const re = new RegExp(searchValue, 'gi'); - return re.exec(bookValue); + const re = new RegExp(searchValue, 'i'); + return re.test(bookValue); } else { //where = `@dirtyIndexLR('value', ${db.esc(a)}, ${db.esc(a + maxUtf8Char)})`; return bookValue.localeCompare(searchValue) >= 0 && bookValue.localeCompare(searchValue + maxUtf8Char) <= 0; From 71f2674b3814e3eb8f216dee25f04580808f9fc1 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 11 Dec 2022 18:07:23 +0700 Subject: [PATCH 06/12] gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index d012435..c339748 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /node_modules /server/.inpx-web* -/server/inpx-web-filter.json /dist dev*.sh \ No newline at end of file From 46f40d29be70c537b1a47a61b846df12eff42646 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 11 Dec 2022 18:08:09 +0700 Subject: [PATCH 07/12] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B9=20?= =?UTF-8?q?=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=B8=D0=BD?= =?UTF-8?q?=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/index.js b/server/index.js index 92427df..dcf5617 100644 --- a/server/index.js +++ b/server/index.js @@ -16,16 +16,16 @@ let branch = ''; const argvStrings = ['host', 'port', 'app-dir', 'lib-dir', 'inpx']; function showHelp(defaultConfig) { - console.log(utils.versionText(config)); + console.log(utils.versionText(defaultConfig)); console.log( -`Usage: ${config.name} [options] +`Usage: ${defaultConfig.name} [options] Options: - --help Print ${config.name} command line options + --help Print ${defaultConfig.name} command line options --host= Set web server host, default: ${defaultConfig.server.host} --port= Set web server port, default: ${defaultConfig.server.port} - --app-dir= Set application working directory, default: /.${config.name} - --lib-dir= Set library directory, default: the same as ${config.name} executable's + --app-dir= Set application working directory, default: /.${defaultConfig.name} + --lib-dir= Set library directory, default: the same as ${defaultConfig.name} executable's --inpx= Set INPX collection file, default: the one that found in library dir --recreate Force recreation of the search database on start ` From 6e2ff07a489c21d8d3945f45e7a166c23f6d66e3 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Mon, 12 Dec 2022 17:27:29 +0700 Subject: [PATCH 08/12] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/core/ZipReader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/core/ZipReader.js b/server/core/ZipReader.js index 83e3532..614c61c 100644 --- a/server/core/ZipReader.js +++ b/server/core/ZipReader.js @@ -1,4 +1,4 @@ -const StreamZip = require('node-stream-zip'); +const StreamUnzip = require('node-stream-zip'); class ZipReader { constructor() { @@ -14,7 +14,7 @@ class ZipReader { if (this.zip) throw new Error('Zip file is already open'); - const zip = new StreamZip.async({file: zipFile, skipEntryNameValidation: true}); + const zip = new StreamUnzip.async({file: zipFile, skipEntryNameValidation: true}); if (zipEntries) this.zipEntries = await zip.entries(); From 070c667605409fcf53953eca69cb2e3658eb9325 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 15 Dec 2022 16:26:22 +0700 Subject: [PATCH 09/12] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B2=D1=81=D1=82=D1=80=D0=B0=D0=B8=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B2=20liberama?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Search/Search.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/client/components/Search/Search.vue b/client/components/Search/Search.vue index c0b563e..7d3700a 100644 --- a/client/components/Search/Search.vue +++ b/client/components/Search/Search.vue @@ -593,6 +593,7 @@ class Search { this.list.liberamaReady = true; this.sendMessage({type: 'mes', data: 'ready'}); this.sendCurrentUrl(); + this.makeTitle(); break; } } From 024a5f9b8c25352c64a8b48a9d36f5bd9d84c87e Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 21 Dec 2022 13:42:54 +0700 Subject: [PATCH 10/12] =?UTF-8?q?=D0=97=D0=B0=D0=BF=D0=BB=D0=B0=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20(#10)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Search/AuthorList/AuthorList.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/components/Search/AuthorList/AuthorList.vue b/client/components/Search/AuthorList/AuthorList.vue index 2f5892a..bc22ac2 100644 --- a/client/components/Search/AuthorList/AuthorList.vue +++ b/client/components/Search/AuthorList/AuthorList.vue @@ -197,8 +197,12 @@ class AuthorList extends BaseList { result = `${count}`; if (item.seriesLoaded) { const rec = item.seriesLoaded[book.series]; - const totalCount = (this.showDeleted ? rec.bookCount + rec.bookDelCount : rec.bookCount); - result += `/${totalCount}`; + // заплатка для исправления https://github.com/bookpauk/inpx-web/issues/10 + // по невыясненным причинам rec иногда равен undefined + if (rec) { + const totalCount = (this.showDeleted ? rec.bookCount + rec.bookDelCount : rec.bookCount); + result += `/${totalCount}`; + } } return `(${result})`; From a2db43bbe1d52f1723f379046917c62278714f74 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 21 Dec 2022 13:44:27 +0700 Subject: [PATCH 11/12] CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35bc5c8..9ed7392 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ -1.5.0 / 2022-12-?? +1.4.1 / 2022-12-21 ------------------ - Добавлена возможность поиска по регулярному выражению (префикс "~") +- Заплатка для исправления (#10) 1.4.0 / 2022-12-07 ------------------ From b34d91559735535859db1eadd9d95a56a3bf9d25 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 21 Dec 2022 13:45:10 +0700 Subject: [PATCH 12/12] =?UTF-8?q?=D0=92=D0=B5=D1=80=D1=81=D0=B8=D1=8F=201.?= =?UTF-8?q?4.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1c6cb2a..fd29334 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "inpx-web", - "version": "1.4.0", + "version": "1.4.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "inpx-web", - "version": "1.4.0", + "version": "1.4.1", "hasInstallScript": true, "license": "CC0-1.0", "dependencies": { diff --git a/package.json b/package.json index 51d0c9d..a664baf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "inpx-web", - "version": "1.4.0", + "version": "1.4.1", "author": "Book Pauk ", "license": "CC0-1.0", "repository": "bookpauk/inpx-web",