X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FEpub.java;h=ad4d65f5a4c180b8d68db15e4d0d0a860e72cfdd;hb=62c63b0724f4bc45999cb2e7186b4b3ada479a0a;hp=6819ec29e272f1ee319fdf69da893b8d20855a77;hpb=b7afbe4297ae1f0c4db57cc431c2341b9fc6c061;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/supported/Epub.java b/src/be/nikiroo/fanfix/supported/Epub.java index 6819ec2..ad4d65f 100644 --- a/src/be/nikiroo/fanfix/supported/Epub.java +++ b/src/be/nikiroo/fanfix/supported/Epub.java @@ -6,6 +6,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; +import java.net.URLDecoder; import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; @@ -127,7 +128,7 @@ class Epub extends InfoText { try { cover = ImageUtils.fromStream(zipIn); } catch (Exception e) { - Instance.syserr(e); + Instance.getTraceHandler().error(e); } } } else if (entry.getName().equals(getDataPrefix() + "URL")) { @@ -180,6 +181,14 @@ class Epub extends InfoText { } tmpInfo.delete(); } else { + if (title == null || title.isEmpty()) { + title = new File(source.getPath()).getName(); + if (title.toLowerCase().endsWith(".cbz")) { + title = title.substring(0, title.length() - 4); + } + title = URLDecoder.decode(title, "UTF-8").trim(); + } + meta = new MetaData(); meta.setLang("EN"); meta.setTags(new ArrayList());