git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit '3519cb5c518d569235beaedfc3071cba45ec848d'
[fanfix.git]
/
src
/
be
/
nikiroo
/
fanfix
/
supported
/
Cbz.java
diff --git
a/src/be/nikiroo/fanfix/supported/Cbz.java
b/src/be/nikiroo/fanfix/supported/Cbz.java
index 3682afe520706748c36e1132cf56770d02c919bb..22e436a22188b6e0442ba5f21c977ca0ddaed90c 100644
(file)
--- a/
src/be/nikiroo/fanfix/supported/Cbz.java
+++ b/
src/be/nikiroo/fanfix/supported/Cbz.java
@@
-13,6
+13,7
@@
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import be.nikiroo.fanfix.Instance;
import java.util.zip.ZipInputStream;
import be.nikiroo.fanfix.Instance;
+import be.nikiroo.fanfix.bundles.Config;
import be.nikiroo.fanfix.data.Chapter;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Paragraph;
import be.nikiroo.fanfix.data.Chapter;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Paragraph;
@@
-85,12
+86,12
@@
class Cbz extends Epub {
&& entry.getName().startsWith(getDataPrefix())) {
String entryLName = entry.getName().toLowerCase();
boolean imageEntry = false;
&& entry.getName().startsWith(getDataPrefix())) {
String entryLName = entry.getName().toLowerCase();
boolean imageEntry = false;
- for (String ext :
BasicSupport
Images.getImageExt(false)) {
+ for (String ext :
bs
Images.getImageExt(false)) {
if (entryLName.endsWith(ext)) {
imageEntry = true;
}
}
if (entryLName.endsWith(ext)) {
imageEntry = true;
}
}
-
+
if (imageEntry) {
String uuid = meta.getUuid() + "_" + entry.getName();
try {
if (imageEntry) {
String uuid = meta.getUuid() + "_" + entry.getName();
try {
@@
-111,6
+112,14
@@
class Cbz extends Epub {
}
}
}
}
}
}
+
+ String ext = "."
+ + Instance.getConfig()
+ .getString(Config.FILE_FORMAT_IMAGE_FORMAT_COVER)
+ .toLowerCase();
+ String coverName = meta.getUuid() + "_" + basename + ext;
+ Image cover = images.get(coverName);
+ images.remove(coverName);
pg.setProgress(85);
pg.setProgress(85);
@@
-120,7
+129,7
@@
class Cbz extends Epub {
pg.setProgress(90);
pg.setProgress(90);
- // only the description is kept
+ // only the description
/cover
is kept
Story origStory = getStoryFromTxt(tmpDir, basename);
if (origStory != null) {
if (origStory.getMeta().getCover() == null) {
Story origStory = getStoryFromTxt(tmpDir, basename);
if (origStory != null) {
if (origStory.getMeta().getCover() == null) {
@@
-128,6
+137,9
@@
class Cbz extends Epub {
}
story.setMeta(origStory.getMeta());
}
}
story.setMeta(origStory.getMeta());
}
+ if (story.getMeta().getCover() == null) {
+ story.getMeta().setCover(cover);
+ }
story.setChapters(new ArrayList<Chapter>());
// Check if we can find non-images chapters, for hybrid-cbz support
story.setChapters(new ArrayList<Chapter>());
// Check if we can find non-images chapters, for hybrid-cbz support