X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=supported%2FBasicSupport_Deprecated.java;h=512aabf390d8cf9a9aa07fcf692a491249510d2e;hb=379a497e6fd2b959c57b2ff4023413e2daf36232;hp=ad030c0ced64825def174a7bfed5d81b4f00c7d9;hpb=75a6a3eadc87e42bb0c9808e359d23d03801a9a2;p=fanfix.git diff --git a/supported/BasicSupport_Deprecated.java b/supported/BasicSupport_Deprecated.java index ad030c0..512aabf 100644 --- a/supported/BasicSupport_Deprecated.java +++ b/supported/BasicSupport_Deprecated.java @@ -203,7 +203,14 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { pg.setProgress(30); Story story = new Story(); + MetaData meta = getMeta(url, getInput()); + meta.setType(getType().toString()); + meta.setSource(getType().getSourceName()); + if (meta.getPublisher() == null) { + meta.setPublisher(getType().getSourceName()); + } + if (meta.getCreationDate() == null || meta.getCreationDate().trim().isEmpty()) { meta.setCreationDate(bsHelper.formatDate( @@ -317,7 +324,6 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { words += cc.getWords(); story.getChapters().add(cc); - story.getMeta().setWords(words); } finally { if (chapIn != null) { chapIn.close(); @@ -326,6 +332,8 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { i++; } + + story.getMeta().setWords(words); pgChaps.setName("Extracting chapters"); } else { @@ -340,6 +348,7 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { resume.setName(""); resume.setNumber(1); story.getChapters().add(resume); + story.getMeta().setWords(resume.getWords()); String descChapterName = Instance.getInstance().getTrans() .getString(StringId.DESCRIPTION); @@ -649,7 +658,13 @@ public abstract class BasicSupport_Deprecated extends BasicSupport { InputStream in = null; try { in = Instance.getInstance().getCache().open(url, getSupport(url), true); - return new Image(in); + Image img = new Image(in); + if (img.getSize() == 0) { + img.close(); + throw new IOException( + "Empty image not accepted"); + } + return img; } catch (IOException e) { } finally { if (in != null) {