X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=supported%2FMangaLel.java;h=5910a371aedf7272e546ec7170b508516879ced1;hp=1ba51bc0f5d8a5c32a0341526a5aac142ae3fff6;hb=002972e9de731678035d56304d75a6d9e8233635;hpb=0fc81e6465aa9c1f1dfc19b532082220d609768a diff --git a/supported/MangaLel.java b/supported/MangaLel.java index 1ba51bc..5910a37 100644 --- a/supported/MangaLel.java +++ b/supported/MangaLel.java @@ -32,7 +32,7 @@ class MangaLel extends BasicSupport { meta.setTitle(getTitle()); meta.setAuthor(getAuthor()); - meta.setDate(getDate()); + meta.setDate(bsHelper.formatDate(getDate())); meta.setTags(getTags()); meta.setSource(getType().getSourceName()); meta.setUrl(getSource().toString()); @@ -102,15 +102,6 @@ class MangaLel extends BasicSupport { } } - if (!value.isEmpty()) { - try { - long time = StringUtils.toTime(value); - value = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") - .format(time); - } catch (ParseException e) { - } - } - return value; } @@ -147,17 +138,22 @@ class MangaLel extends BasicSupport { if (img != null) { String coverUrl = img.absUrl("src"); - InputStream coverIn; try { - coverIn = Instance.getCache().open(new URL(coverUrl), this, - true); + InputStream coverIn = Instance.getInstance().getCache() + .open(new URL(coverUrl), this, true); try { - return new Image(coverIn); + Image ii = new Image(coverIn); + if (ii.getSize() == 0) { + ii.close(); + throw new IOException("Empty image not accepted"); + } + + return ii; } finally { coverIn.close(); } } catch (IOException e) { - Instance.getTraceHandler().error(e); + Instance.getInstance().getTraceHandler().error(e); } } } @@ -209,7 +205,7 @@ class MangaLel extends BasicSupport { StringBuilder builder = new StringBuilder(); - InputStream in = Instance.getCache().open(chapUrl, this, false); + InputStream in = Instance.getInstance().getCache().open(chapUrl, this, false); try { Element pageDoc = DataUtil.load(in, "UTF-8", chapUrl.toString()); Element content = pageDoc.getElementById("content");