git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit '7a455971fed716123933d0f685a0d6eebcf3282b'
[nikiroo-utils.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 c7475fa775640e39f57aa8b1d218ab3cd51841b8..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;
@@
-90,7
+91,7
@@
class Cbz extends Epub {
imageEntry = true;
}
}
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