mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-06-16 17:34:43 +12:00
make metadata cacheable
This commit is contained in:
parent
5555b20d47
commit
5027cdff63
|
@ -4,7 +4,7 @@
|
|||
"name": "fimfic2epub",
|
||||
"short_name": "fimfic2epub",
|
||||
"description": "Improved EPUB exporter for Fimfiction",
|
||||
"version": "1.1.5",
|
||||
"version": "1.1.6",
|
||||
|
||||
"icons": {
|
||||
"128": "icon-128.png"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "fimfic2epub",
|
||||
"version": "1.1.5",
|
||||
"version": "1.1.6",
|
||||
"description": "Tool to generate EPUB ebooks from fimfiction stories",
|
||||
"author": "djazz",
|
||||
"repository": {
|
||||
|
|
|
@ -53,7 +53,17 @@ module.exports = class FimFic2Epub {
|
|||
reject(data.error)
|
||||
return
|
||||
}
|
||||
if (!data.story.chapters) data.story.chapters = []
|
||||
let story = data.story
|
||||
// this is so the metadata can be cached.
|
||||
if (!story.chapters) story.chapters = []
|
||||
delete story.likes
|
||||
delete story.dislikes
|
||||
delete story.views
|
||||
delete story.total_views
|
||||
delete story.comments
|
||||
story.chapters.forEach((ch) => {
|
||||
delete ch.views
|
||||
})
|
||||
resolve(data.story)
|
||||
})
|
||||
})
|
||||
|
@ -416,7 +426,7 @@ module.exports = class FimFic2Epub {
|
|||
compressionOptions: {level: 9}
|
||||
}).then((file) => {
|
||||
this.cachedFile = file
|
||||
resolve(file)
|
||||
resolve(file, this.filename)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue