quickfix! the sort broke the order :(

This commit is contained in:
daniel-j 2016-08-19 12:22:41 +02:00
parent 8a9bbece0d
commit c32ea6156e
3 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@
"name": "fimfic2epub",
"short_name": "fimfic2epub",
"description": "Improved EPUB exporter for Fimfiction",
"version": "1.2.0",
"version": "1.2.1",
"icons": {
"128": "icon-128.png"

View file

@ -1,6 +1,6 @@
{
"name": "fimfic2epub",
"version": "1.2.0",
"version": "1.2.1",
"description": "Tool to generate improved EPUB ebooks from Fimfiction stories",
"author": "djazz",
"repository": {

View file

@ -78,7 +78,7 @@ export function createChapter (ch, html, callback) {
}
// some eReaders doesn't understand linear=no, so sort those items to the end of the spine/book.
function sortItemsLinear (a, b) {
/* function sortItemsLinear (a, b) {
let linearA = a.attrs.linear !== 'no'
let linearB = b.attrs.linear !== 'no'
if (linearA === linearB) {
@ -88,7 +88,7 @@ function sortItemsLinear (a, b) {
} else {
return 1
}
}
} */
export function createOpf (ffc) {
let remotes = []
@ -142,7 +142,7 @@ export function createOpf (ffc) {
m('itemref', {idref: 'nav', linear: ffc.storyInfo.chapters.length <= 1 ? 'no' : undefined})
].concat(ffc.storyInfo.chapters.map((ch, num) =>
m('itemref', {idref: 'chapter_' + zeroFill(3, num + 1)})
)).sort(sortItemsLinear)),
))),
m('guide', [
m('reference', {type: 'cover', title: 'Cover', href: 'Text/cover.xhtml'}),