Работа над разделом "Серии"
This commit is contained in:
@@ -163,7 +163,7 @@ class WebSocketController {
|
||||
}
|
||||
|
||||
async getSeriesBookList(req, ws) {
|
||||
const result = await this.webWorker.getSeriesBookList(req.series, req.seriesId);
|
||||
const result = await this.webWorker.getSeriesBookList(req.series);
|
||||
|
||||
this.send(result, req, ws);
|
||||
}
|
||||
|
||||
@@ -483,11 +483,11 @@ class DbSearcher {
|
||||
}
|
||||
}
|
||||
|
||||
async getSeriesBookList(series, seriesId) {
|
||||
async getSeriesBookList(series) {
|
||||
if (this.closed)
|
||||
throw new Error('DbSearcher closed');
|
||||
|
||||
if (!series && !seriesId)
|
||||
if (!series)
|
||||
return {books: ''};
|
||||
|
||||
this.searchFlag++;
|
||||
@@ -500,15 +500,16 @@ class DbSearcher {
|
||||
//выборка серии по названию серии
|
||||
let rows = await db.select({
|
||||
table: 'series',
|
||||
where: `@@dirtyIndexLR('value', ${db.esc(series)}, ${db.esc(series)})`
|
||||
rawResult: true,
|
||||
where: `return Array.from(@dirtyIndexLR('value', ${db.esc(series)}, ${db.esc(series)}))`
|
||||
});
|
||||
|
||||
let books;
|
||||
if (rows.length) {
|
||||
if (rows.length && rows[0].rawResult.length) {
|
||||
//выборка книг серии
|
||||
rows = await db.select({
|
||||
table: 'series_book',
|
||||
where: `@@id(${rows[0].id})`
|
||||
where: `@@id(${rows[0].rawResult[0]})`
|
||||
});
|
||||
|
||||
if (rows.length)
|
||||
|
||||
@@ -277,10 +277,10 @@ class WebWorker {
|
||||
return await this.dbSearcher.getAuthorBookList(authorId);
|
||||
}
|
||||
|
||||
async getSeriesBookList(series, seriesId) {
|
||||
async getSeriesBookList(series) {
|
||||
this.checkMyState();
|
||||
|
||||
return await this.dbSearcher.getSeriesBookList(series, seriesId);
|
||||
return await this.dbSearcher.getSeriesBookList(series);
|
||||
}
|
||||
|
||||
async getGenreTree() {
|
||||
|
||||
Reference in New Issue
Block a user