X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=supported%2FMangaLel.java;h=47efad8594a71830a33e5de698e47256c3d87616;hp=9929699cc43839b93e1b98752d205d562a08a845;hb=258e065f81071a861711ef935dca3ec5563f4360;hpb=2e1300b9580ae1b6dded5a734c617a66a116c16d diff --git a/supported/MangaLel.java b/supported/MangaLel.java index 9929699..47efad8 100644 --- a/supported/MangaLel.java +++ b/supported/MangaLel.java @@ -32,16 +32,13 @@ 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()); - meta.setPublisher(getType().getSourceName()); meta.setUuid(getSource().toString()); meta.setLuid(""); meta.setLang("fr"); meta.setSubject("manga"); - meta.setType(getType().toString()); meta.setImageDocument(true); meta.setCover(getCover()); @@ -102,15 +99,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,11 +135,17 @@ class MangaLel extends BasicSupport { if (img != null) { String coverUrl = img.absUrl("src"); - InputStream coverIn; try { - coverIn = Instance.getInstance().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(); }