Переименования
This commit is contained in:
@@ -202,8 +202,8 @@ class Api {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async search(query) {
|
async authorSearch(query) {
|
||||||
const response = await this.request({action: 'search', query});
|
const response = await this.request({action: 'author-search', query});
|
||||||
|
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
throw new Error(response.error);
|
throw new Error(response.error);
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ class AuthorList extends BaseList {
|
|||||||
})();
|
})();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await this.api.search(query);
|
const result = await this.api.authorSearch(query);
|
||||||
|
|
||||||
this.list.queryFound = result.author.length;
|
this.list.queryFound = result.author.length;
|
||||||
this.list.totalFound = result.totalFound;
|
this.list.totalFound = result.totalFound;
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ class WebSocketController {
|
|||||||
await this.getConfig(req, ws); break;
|
await this.getConfig(req, ws); break;
|
||||||
case 'get-worker-state':
|
case 'get-worker-state':
|
||||||
await this.getWorkerState(req, ws); break;
|
await this.getWorkerState(req, ws); break;
|
||||||
case 'search':
|
case 'author-search':
|
||||||
await this.search(req, ws); break;
|
await this.authorSearch(req, ws); break;
|
||||||
case 'get-book-list':
|
case 'get-book-list':
|
||||||
await this.getBookList(req, ws); break;
|
await this.getBookList(req, ws); break;
|
||||||
case 'get-series-book-list':
|
case 'get-series-book-list':
|
||||||
@@ -133,11 +133,11 @@ class WebSocketController {
|
|||||||
this.send((state ? state : {}), req, ws);
|
this.send((state ? state : {}), req, ws);
|
||||||
}
|
}
|
||||||
|
|
||||||
async search(req, ws) {
|
async authorSearch(req, ws) {
|
||||||
if (!req.query)
|
if (!req.query)
|
||||||
throw new Error(`query is empty`);
|
throw new Error(`query is empty`);
|
||||||
|
|
||||||
const result = await this.webWorker.search(req.query);
|
const result = await this.webWorker.authorSearch(req.query);
|
||||||
|
|
||||||
this.send(result, req, ws);
|
this.send(result, req, ws);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ class DbSearcher {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async search(query) {
|
async authorSearch(query) {
|
||||||
if (this.closed)
|
if (this.closed)
|
||||||
throw new Error('DbSearcher closed');
|
throw new Error('DbSearcher closed');
|
||||||
|
|
||||||
|
|||||||
@@ -245,11 +245,11 @@ class WebWorker {
|
|||||||
return db.wwCache.config;
|
return db.wwCache.config;
|
||||||
}
|
}
|
||||||
|
|
||||||
async search(query) {
|
async authorSearch(query) {
|
||||||
this.checkMyState();
|
this.checkMyState();
|
||||||
|
|
||||||
const config = await this.dbConfig();
|
const config = await this.dbConfig();
|
||||||
const result = await this.dbSearcher.search(query);
|
const result = await this.dbSearcher.authorSearch(query);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
author: result.result,
|
author: result.result,
|
||||||
|
|||||||
Reference in New Issue
Block a user