X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FFimfictionApi.java;h=e6dd6118721b93aec36c0d7c734faad1c6d9a95b;hb=0a264fbe3d5a43516006052574a5f322d9d38897;hp=6c6d7ba31caf2197356b68168447c7871b257a52;hpb=4d9e85d00d491422eb436d05b5de5af0cb326cdb;p=fanfix.git diff --git a/src/be/nikiroo/fanfix/supported/FimfictionApi.java b/src/be/nikiroo/fanfix/supported/FimfictionApi.java index 6c6d7ba..e6dd611 100644 --- a/src/be/nikiroo/fanfix/supported/FimfictionApi.java +++ b/src/be/nikiroo/fanfix/supported/FimfictionApi.java @@ -124,7 +124,8 @@ 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()); @@ -146,7 +147,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(); }