save titles

This commit is contained in:
Daniel Bulant 2021-05-24 16:35:21 +02:00
parent 23d6247d35
commit 83c4b0891d
2 changed files with 4 additions and 2 deletions

View file

@ -61,7 +61,8 @@
});
const zip = await prepareEpub({
title: `https://manga.danbulant.eu/${mangaId}/${chapter.data.id}`,
title: `${manga.title.en} ${chapter.data.attributes.chapter}`,
id: `https://manga.danbulant.eu/${mangaId}/${chapter.data.id}`,
file,
chapter: chapter.data.attributes.chapter,
links: hashes,

View file

@ -8,6 +8,7 @@ const enc = new TextEncoder();
* @param {WritableStream} opts.file
* @param {number} opts.chapter
* @param {string|Date} opts.updatedAt
* @param {string} opts.id
*/
export async function prepareEpub(opts) {
const writer = opts.file.getWriter();
@ -51,7 +52,7 @@ export async function prepareEpub(opts) {
<dc:title>${opts.title}</dc:title>
<dc:language>en</dc:language>
<dc:creator>Unknown</dc:creator>
<dc:identifier id="bookid"></dc:identifier>
<dc:identifier id="bookid">${opts.id}</dc:identifier>
<dc:type>Image</dc:type>
<meta property="dcterms:modified">${opts.updatedAt.toString().split("+")[0]}Z</meta>