X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FCbz.java;h=295dc15a92ddc699792fdd4914c7a05f14056918;hp=1080ad2755adebb174ad7a3e04f4053c9e0b35f4;hb=92fb0719f84f5b6734b51e528332546d78e9ccec;hpb=d98a29006897a1ae31ff3a039afe9643a48e0704 diff --git a/src/be/nikiroo/fanfix/supported/Cbz.java b/src/be/nikiroo/fanfix/supported/Cbz.java index 1080ad2..295dc15 100644 --- a/src/be/nikiroo/fanfix/supported/Cbz.java +++ b/src/be/nikiroo/fanfix/supported/Cbz.java @@ -14,6 +14,7 @@ import be.nikiroo.fanfix.Instance; import be.nikiroo.fanfix.data.Chapter; import be.nikiroo.fanfix.data.Paragraph; import be.nikiroo.fanfix.data.Story; +import be.nikiroo.utils.ui.Progress; /** * Support class for CBZ files (works better with CBZ created with this program, @@ -54,7 +55,13 @@ class Cbz extends Epub { } @Override - public Story process(URL url) throws IOException { + public Story process(URL url, Progress pg) throws IOException { + if (pg == null) { + pg = new Progress(); + } else { + pg.setMinMax(0, 100); + } + Story story = processMeta(url, false, true); story.setChapters(new ArrayList()); Chapter chap = new Chapter(1, null); @@ -62,6 +69,7 @@ class Cbz extends Epub { ZipInputStream zipIn = new ZipInputStream(getInput()); + pg.setProgress(10); List images = new ArrayList(); for (ZipEntry entry = zipIn.getNextEntry(); entry != null; entry = zipIn .getNextEntry()) { @@ -87,8 +95,11 @@ class Cbz extends Epub { } } + pg.setProgress(80); + // ZIP order is not sure Collections.sort(images); + pg.setProgress(90); for (String uuid : images) { try { @@ -99,6 +110,7 @@ class Cbz extends Epub { } } + pg.setProgress(100); return story; } }