Работа над BookInfoDialog

This commit is contained in:
Book Pauk
2022-11-06 17:15:45 +07:00
parent 351abe9401
commit d9f1912ea2
7 changed files with 119 additions and 1 deletions

View File

@@ -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');