Работа над BookInfoDialog
This commit is contained in:
@@ -84,6 +84,8 @@ class WebSocketController {
|
||||
await this.getGenreTree(req, ws); break;
|
||||
case 'get-book-link':
|
||||
await this.getBookLink(req, ws); break;
|
||||
case 'get-book-info':
|
||||
await this.getBookInfo(req, ws); break;
|
||||
|
||||
case 'get-inpx-file':
|
||||
await this.getInpxFile(req, ws); break;
|
||||
@@ -173,6 +175,17 @@ class WebSocketController {
|
||||
this.send(result, req, ws);
|
||||
}
|
||||
|
||||
async getBookInfo(req, ws) {
|
||||
if (!utils.hasProp(req, 'bookPath'))
|
||||
throw new Error(`bookPath is empty`);
|
||||
if (!utils.hasProp(req, 'downFileName'))
|
||||
throw new Error(`downFileName is empty`);
|
||||
|
||||
const result = await this.webWorker.getBookInfo({bookPath: req.bookPath, downFileName: req.downFileName});
|
||||
|
||||
this.send(result, req, ws);
|
||||
}
|
||||
|
||||
async getInpxFile(req, ws) {
|
||||
if (!this.config.allowRemoteLib)
|
||||
throw new Error('Remote lib access disabled');
|
||||
|
||||
Reference in New Issue
Block a user