Работа над opds
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const path = require('path');
|
||||
const BasePage = require('./BasePage');
|
||||
|
||||
class BookPage extends BasePage {
|
||||
@@ -16,21 +17,29 @@ class BookPage extends BasePage {
|
||||
if (bookUid) {
|
||||
const {bookInfo} = await this.webWorker.getBookInfo(bookUid);
|
||||
if (bookInfo) {
|
||||
entry.push(
|
||||
this.makeEntry({
|
||||
id: bookUid,
|
||||
title: bookInfo.book.title || 'Без названия',
|
||||
link: [
|
||||
//this.imgLink({href: bookInfo.cover, type: coverType}),
|
||||
this.acqLink({href: bookInfo.link, type: `application/${bookInfo.book.ext}+gzip`}),
|
||||
],
|
||||
})
|
||||
);
|
||||
const e = this.makeEntry({
|
||||
id: bookUid,
|
||||
title: bookInfo.book.title || 'Без названия',
|
||||
link: [
|
||||
this.downLink({href: bookInfo.link, type: `application/${bookInfo.book.ext}+zip`}),
|
||||
],
|
||||
});
|
||||
|
||||
if (bookInfo.cover) {
|
||||
let coverType = 'image/jpeg';
|
||||
if (path.extname(bookInfo.cover) == '.png')
|
||||
coverType = 'image/png';
|
||||
|
||||
e.link.push(this.imgLink({href: bookInfo.cover, type: coverType}));
|
||||
e.link.push(this.imgLink({href: bookInfo.cover, type: coverType, thumb: true}));
|
||||
}
|
||||
|
||||
entry.push(e);
|
||||
}
|
||||
}
|
||||
|
||||
result.entry = entry;
|
||||
return this.makeBody(result);
|
||||
return this.makeBody(result, req);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user