cbz: fix support to discard story
authorNiki Roo <niki@nikiroo.be>
Tue, 26 Mar 2019 17:40:12 +0000 (18:40 +0100)
committerNiki Roo <niki@nikiroo.be>
Tue, 26 Mar 2019 17:40:12 +0000 (18:40 +0100)
src/be/nikiroo/fanfix/supported/Cbz.java

index 6fadad7c5ce558561d007b3c08a3934844d82f3e..3aaa355b7b0827015e8334af7362f56c2bdc966d 100644 (file)
@@ -72,7 +72,7 @@ class Cbz extends Epub {
                pg.addProgress(pgMeta, 10);
                Story story = processMeta(true, pgMeta);
                MetaData meta = story.getMeta();
-               
+
                pgMeta.done(); // 10%
 
                File tmpDir = Instance.getTempFiles().createTempDir("info-text");
@@ -126,17 +126,15 @@ class Cbz extends Epub {
 
                        pg.setProgress(90);
 
-                       // include original story
+                       // only the description is kept, we do not support hybrid CBZ
                        Story origStory = getStoryFromTxt(tmpDir, basename);
                        if (origStory != null) {
-                               story.setChapters(origStory.getChapters());
                                if (origStory.getMeta().getCover() == null) {
                                        origStory.getMeta().setCover(story.getMeta().getCover());
                                }
                                story.setMeta(origStory.getMeta());
-                       } else {
-                               story.setChapters(new ArrayList<Chapter>());
                        }
+                       story.setChapters(new ArrayList<Chapter>());
 
                        if (!imagesList.isEmpty()) {
                                Chapter chap = new Chapter(story.getChapters().size() + 1, null);