|
@@ -130,15 +130,15 @@ class BookPage extends BasePage {
|
|
|
|
|
|
//format
|
|
//format
|
|
const ext = bookInfo.book.ext;
|
|
const ext = bookInfo.book.ext;
|
|
- let fileFormat = `${ext}+zip`;
|
|
|
|
- let downHref = bookInfo.link;
|
|
|
|
|
|
+ const formats = {
|
|
|
|
+ [`${ext}+zip`]: `${bookInfo.link}/zip`,
|
|
|
|
+ [ext]: bookInfo.link,
|
|
|
|
+ };
|
|
|
|
|
|
if (ext === 'mobi') {
|
|
if (ext === 'mobi') {
|
|
- fileFormat = 'x-mobipocket-ebook';
|
|
|
|
|
|
+ formats['x-mobipocket-ebook'] = bookInfo.link;
|
|
} else if (ext == 'epub') {
|
|
} else if (ext == 'epub') {
|
|
- //
|
|
|
|
- } else {
|
|
|
|
- downHref = `${bookInfo.link}/zip`;
|
|
|
|
|
|
+ formats[`${ext}+zip`] = bookInfo.link;
|
|
}
|
|
}
|
|
|
|
|
|
//entry
|
|
//entry
|
|
@@ -153,7 +153,7 @@ class BookPage extends BasePage {
|
|
}
|
|
}
|
|
|
|
|
|
e['dc:language'] = bookInfo.book.lang;
|
|
e['dc:language'] = bookInfo.book.lang;
|
|
- e['dc:format'] = fileFormat;
|
|
|
|
|
|
+ e['dc:format'] = ext;
|
|
|
|
|
|
//genre
|
|
//genre
|
|
const genre = bookInfo.book.genre.split(',');
|
|
const genre = bookInfo.book.genre.split(',');
|
|
@@ -200,7 +200,10 @@ class BookPage extends BasePage {
|
|
}
|
|
}
|
|
|
|
|
|
//links
|
|
//links
|
|
- e.link = [ this.downLink({href: downHref, type: `application/${fileFormat}`}) ];
|
|
|
|
|
|
+ e.link = [];
|
|
|
|
+ for (const [fileFormat, downHref] of Object.entries(formats))
|
|
|
|
+ e.link.push(this.downLink({href: downHref, type: `application/${fileFormat}`}));
|
|
|
|
+
|
|
if (bookInfo.cover) {
|
|
if (bookInfo.cover) {
|
|
let coverType = 'image/jpeg';
|
|
let coverType = 'image/jpeg';
|
|
if (path.extname(bookInfo.cover) == '.png')
|
|
if (path.extname(bookInfo.cover) == '.png')
|