Добавлена возможность отображения всех книг серии
This commit is contained in:
@@ -153,10 +153,10 @@ class WebSocketController {
|
||||
}
|
||||
|
||||
async getSeriesBookList(req, ws) {
|
||||
if (!utils.hasProp(req, 'seriesId'))
|
||||
throw new Error(`seriesId is empty`);
|
||||
if (!utils.hasProp(req, 'series'))
|
||||
throw new Error(`series is empty`);
|
||||
|
||||
const result = await this.webWorker.getSeriesBookList(req.seriesId);
|
||||
const result = await this.webWorker.getSeriesBookList(req.series);
|
||||
|
||||
this.send(result, req, ws);
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ class DbSearcher {
|
||||
}
|
||||
}
|
||||
|
||||
async getSeriesBookList(seriesId) {
|
||||
async getSeriesBookList(series) {
|
||||
if (this.closed)
|
||||
throw new Error('DbSearcher closed');
|
||||
|
||||
@@ -301,10 +301,11 @@ class DbSearcher {
|
||||
try {
|
||||
const db = this.db;
|
||||
|
||||
//выборка серии по seriesId
|
||||
series = series.toLowerCase();
|
||||
//выборка серии по названию серии
|
||||
const rows = await db.select({
|
||||
table: 'series',
|
||||
where: `@@id(${db.esc(seriesId)})`
|
||||
where: `@@dirtyIndexLR('value', ${db.esc(series)}, ${db.esc(series)})`
|
||||
});
|
||||
|
||||
return {books: (rows.length ? rows[0].books : '')};
|
||||
|
||||
Reference in New Issue
Block a user