Closed mawi12345 closed 9 years ago
btw i have tested the code on a ebook collection of 60.000 books. The only case where ebook-meta
can handle files the do not work with your lib are related to wrong zip headers.
0000000 P K 003 004 024 \0 004 \0 \0 \0 003 005 C < o a
0000010 ? , 024 \0 \0 \0 024 \0 \0 \0 \b \0 \0 \0 m i
0000020 m e t y p e a p p l i c a t i o
0000030 n / e p u b + z i p P K 003 004 024 \0
the file should start with P K 001 002
(central directory header) and not with P K 004 005
(local file header)
If i find time i will try to fork adm-zip
and fix the problem there.
Do you mind just adding curly brackets around if
s to have a consistent style?
Looks good to me otherwise.
oh sorry, now it should be consistent
This PR overcomes the empty text edge case in:
title = (branch[i].navLabel && branch[i].navLabel.text || branch[i].navLabel || "").trim();
if
branch[i].navLabel
is{text: ''}
then this will result inTypeError: Object #<Object> has no method 'trim'
Because the
branch[i].navLabel.text
is an empty string and evaluates tofalse
in the if clause.Furthermore i have moved the variable definition in the for loop.