From: Niki Roo Date: Fri, 23 Mar 2018 13:54:30 +0000 (+0100) Subject: CBZ: fix meta for non-images documents X-Git-Tag: fanfix-swing-0.0.1~12^2~354 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=e4fa48a0b617e0a5368e8e8589909ae93c340447;p=fanfix-swing.git CBZ: fix meta for non-images documents --- diff --git a/src/be/nikiroo/fanfix/supported/Cbz.java b/src/be/nikiroo/fanfix/supported/Cbz.java index b6524aca..8ab2a520 100644 --- a/src/be/nikiroo/fanfix/supported/Cbz.java +++ b/src/be/nikiroo/fanfix/supported/Cbz.java @@ -1,7 +1,6 @@ package be.nikiroo.fanfix.supported; import java.io.IOException; -import java.io.InputStream; import java.net.URL; import java.util.ArrayList; import java.util.Collections; @@ -46,14 +45,13 @@ class Cbz extends Epub { } @Override - protected boolean getCover() { - return false; + protected boolean isImagesDocumentByDefault() { + return true; } @Override - protected void preprocess(URL source, InputStream in) throws IOException { - super.preprocess(source, in); - meta.setImageDocument(true); + protected boolean getCover() { + return false; } @Override diff --git a/src/be/nikiroo/fanfix/supported/Epub.java b/src/be/nikiroo/fanfix/supported/Epub.java index 9b06f202..8ae4c6c3 100644 --- a/src/be/nikiroo/fanfix/supported/Epub.java +++ b/src/be/nikiroo/fanfix/supported/Epub.java @@ -196,6 +196,7 @@ class Epub extends InfoText { meta.setUrl(url); meta.setTitle(title); meta.setAuthor(author); + meta.setImageDocument(isImagesDocumentByDefault()); } } @@ -231,4 +232,8 @@ class Epub extends InfoText { protected boolean getCover() { return true; } + + protected boolean isImagesDocumentByDefault() { + return false; + } } diff --git a/src/be/nikiroo/fanfix/test/ConversionTest.java b/src/be/nikiroo/fanfix/test/ConversionTest.java index 54d08858..07ec7478 100644 --- a/src/be/nikiroo/fanfix/test/ConversionTest.java +++ b/src/be/nikiroo/fanfix/test/ConversionTest.java @@ -235,6 +235,7 @@ class ConversionTest extends TestLauncher { } } + // TODO: remove and use IOUtils when updated private static void unzip(File zipFile, File targetDirectory) throws IOException { if (targetDirectory.exists() && targetDirectory.isFile()) {