X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=supported%2FFimfictionApi.java;h=e6dd6118721b93aec36c0d7c734faad1c6d9a95b;hp=6c6d7ba31caf2197356b68168447c7871b257a52;hb=002972e9de731678035d56304d75a6d9e8233635;hpb=2e1300b9580ae1b6dded5a734c617a66a116c16d diff --git a/supported/FimfictionApi.java b/supported/FimfictionApi.java index 6c6d7ba..e6dd611 100644 --- a/supported/FimfictionApi.java +++ b/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(); }