Improve importing progress reporting
[fanfix.git] / src / be / nikiroo / fanfix / supported / Cbz.java
index 7113248ba485fb4b91ad06f5b614cd49f1b7a3c7..b041b6d468a30a81683465bef8968dd35c9c56e0 100644 (file)
@@ -65,14 +65,19 @@ class Cbz extends Epub {
                        pg.setMinMax(0, 100);
                }
 
-               Story story = processMeta(url, false, true);
+               Progress pgMeta = new Progress();
+               pg.addProgress(pgMeta, 10);
+               Story story = processMeta(url, false, true, pgMeta);
+               if (!pgMeta.isDone()) {
+                       pgMeta.setProgress(pgMeta.getMax()); // 10%
+               }
+
                story.setChapters(new ArrayList<Chapter>());
                Chapter chap = new Chapter(1, null);
                story.getChapters().add(chap);
 
                ZipInputStream zipIn = new ZipInputStream(getInput());
 
-               pg.setProgress(10);
                List<String> images = new ArrayList<String>();
                for (ZipEntry entry = zipIn.getNextEntry(); entry != null; entry = zipIn
                                .getNextEntry()) {