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=6c6d7ba31caf2197356b68168447c7871b257a52;hb=cfdaf6052ddc5ca44cf19f1f6d9f154cc8443024;hpb=a97f9702eae2b51ee64a163f92ec4d72a216e958 diff --git a/src/be/nikiroo/fanfix/supported/FimfictionApi.java b/src/be/nikiroo/fanfix/supported/FimfictionApi.java index 6c6d7ba..cdb1321 100644 --- a/src/be/nikiroo/fanfix/supported/FimfictionApi.java +++ b/src/be/nikiroo/fanfix/supported/FimfictionApi.java @@ -124,16 +124,14 @@ class FimfictionApi extends BasicSupport { meta.setTitle(getKeyJson(json, 0, "type", "story", "title")); meta.setAuthor(getKeyJson(json, 0, "type", "user", "name")); - meta.setDate(getKeyJson(json, 0, "type", "story", "date_published")); + 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", @@ -146,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(); }