X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FFimfictionApi.java;h=cdb132147679b3a912e662a112cd988273382cc0;hp=43d01d19494f616c6811e5757da4a6f2e14c83cc;hb=cfdaf6052ddc5ca44cf19f1f6d9f154cc8443024;hpb=bbeec1a33d25bb3d00ba385099368422cc6ef603 diff --git a/src/be/nikiroo/fanfix/supported/FimfictionApi.java b/src/be/nikiroo/fanfix/supported/FimfictionApi.java index 43d01d1..cdb1321 100644 --- a/src/be/nikiroo/fanfix/supported/FimfictionApi.java +++ b/src/be/nikiroo/fanfix/supported/FimfictionApi.java @@ -127,14 +127,11 @@ class FimfictionApi extends BasicSupport { meta.setDate(bsHelper.formatDate( getKeyJson(json, 0, "type", "story", "date_published"))); meta.setTags(getTags()); - meta.setSource(getType().getSourceName()); meta.setUrl(getSource().toString()); - meta.setPublisher(getType().getSourceName()); meta.setUuid(getSource().toString()); meta.setLuid(""); meta.setLang("en"); meta.setSubject("MLP"); - meta.setType(getType().toString()); meta.setImageDocument(false); String coverImageLink = getKeyJson(json, 0, "type", "story", @@ -147,7 +144,13 @@ class FimfictionApi extends BasicSupport { try { InputStream in = Instance.getInstance().getCache().open(coverImageUrl, null, true); try { - meta.setCover(new Image(in)); + Image img = new Image(in); + if (img.getSize() == 0) { + img.close(); + throw new IOException( + "Empty image not accepted"); + } + meta.setCover(img); } finally { in.close(); }