X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=supported%2FBasicSupport.java;h=17cbec5a984b59c5af1e053aefabdccb2e120140;hb=75a6a3eadc87e42bb0c9808e359d23d03801a9a2;hp=0a5ec3686e1be43c52a328d1a1be86e805ad21fe;hpb=bff19b54d345ceb9e14aef616b53c013e93a0417;p=fanfix.git diff --git a/supported/BasicSupport.java b/supported/BasicSupport.java index 0a5ec36..17cbec5 100644 --- a/supported/BasicSupport.java +++ b/supported/BasicSupport.java @@ -374,7 +374,24 @@ public abstract class BasicSupport { sourceNode = loadDocument(source); try { - return doProcess(pg); + Story story = doProcess(pg); + + // Check for "no chapters" stories + if (story.getChapters().isEmpty() + && story.getMeta().getResume() != null + && !story.getMeta().getResume().getParagraphs().isEmpty()) { + Chapter resume = story.getMeta().getResume(); + resume.setName(""); + resume.setNumber(1); + story.getChapters().add(resume); + + String descChapterName = Instance.getInstance().getTrans() + .getString(StringId.DESCRIPTION); + resume = new Chapter(0, descChapterName); + story.getMeta().setResume(resume); + } + + return story; } finally { close(); } @@ -471,7 +488,8 @@ public abstract class BasicSupport { * the chapter name * @param content * the content of the chapter - * @return the {@link Chapter} + * + * @return the {@link Chapter}, never NULL * * @throws IOException * in case of I/O error