Fix CBZ: do not include the first page twice
[nikiroo-utils.git] / src / be / nikiroo / fanfix / output / Cbz.java
index 2c9dbc3f42df74d1942b0595e1184726b93d6156..8d59ae883a7586d966440cb6aff738ce83e6739a 100644 (file)
@@ -18,7 +18,7 @@ class Cbz extends BasicOutput {
        public File process(Story story, File targetDir, String targetName)
                        throws IOException {
                String targetNameOrig = targetName;
-               targetName += getDefaultExtension();
+               targetName += getDefaultExtension(false);
 
                File target = new File(targetDir, targetName);
 
@@ -28,8 +28,11 @@ class Cbz extends BasicOutput {
 
                // will also save the images!
                new InfoText().process(story, dir, targetNameOrig);
+
                InfoCover.writeInfo(dir, targetNameOrig, story.getMeta());
-               InfoCover.writeCover(dir, targetNameOrig, story.getMeta());
+               if (story.getMeta() != null && !story.getMeta().isFakeCover()) {
+                       InfoCover.writeCover(dir, targetNameOrig, story.getMeta());
+               }
 
                IOUtils.writeSmallFile(dir, "version", "3.0");
 
@@ -45,7 +48,7 @@ class Cbz extends BasicOutput {
        }
 
        @Override
-       public String getDefaultExtension() {
+       public String getDefaultExtension(boolean readerTarget) {
                return ".cbz";
        }