Update nikiroo-utils, remove Instance.syserr/trace
[fanfix.git] / src / be / nikiroo / fanfix / supported / Cbz.java
index 7113248ba485fb4b91ad06f5b614cd49f1b7a3c7..02c667c1032be681186b4e786907243c046eafd9 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()) {
@@ -92,7 +97,7 @@ class Cbz extends Epub {
                                                File tmp = Instance.getCache().addToCache(zipIn, uuid);
                                                images.add(tmp.toURI().toURL().toString());
                                        } catch (Exception e) {
-                                               Instance.syserr(e);
+                                               Instance.getTraceHandler().error(e);
                                        }
                                }
                        }
@@ -108,7 +113,7 @@ class Cbz extends Epub {
                        try {
                                chap.getParagraphs().add(new Paragraph(new URL(uuid)));
                        } catch (Exception e) {
-                               Instance.syserr(e);
+                               Instance.getTraceHandler().error(e);
                        }
                }