X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=supported%2FBasicSupport.java;h=56a3bb80cb6d51fe40a9c4d830e12cb275102d76;hb=8831d290121e3a77f535ce06d61968a26ccf172a;hp=17cbec5a984b59c5af1e053aefabdccb2e120140;hpb=75a6a3eadc87e42bb0c9808e359d23d03801a9a2;p=fanfix.git diff --git a/supported/BasicSupport.java b/supported/BasicSupport.java index 17cbec5..56a3bb8 100644 --- a/supported/BasicSupport.java +++ b/supported/BasicSupport.java @@ -12,6 +12,7 @@ import java.util.Map; import java.util.Scanner; import java.util.Map.Entry; +import org.json.JSONException; import org.json.JSONObject; import org.jsoup.helper.DataUtil; import org.jsoup.nodes.Document; @@ -347,6 +348,8 @@ public abstract class BasicSupport { scan.useDelimiter("\0"); try { return new JSONObject(scan.next()); + } catch (JSONException e) { + throw new IOException(e); } finally { scan.close(); } @@ -384,6 +387,7 @@ public abstract class BasicSupport { resume.setName(""); resume.setNumber(1); story.getChapters().add(resume); + story.getMeta().setWords(resume.getWords()); String descChapterName = Instance.getInstance().getTrans() .getString(StringId.DESCRIPTION); @@ -431,7 +435,7 @@ public abstract class BasicSupport { story.setChapters(new ArrayList()); List> chapters = getChapters(pgGetChapters); pgGetChapters.done(); // 20% - + if (chapters != null) { Progress pgChaps = new Progress("Extracting chapters", 0, chapters.size() * 300); @@ -462,10 +466,11 @@ public abstract class BasicSupport { words += cc.getWords(); story.getChapters().add(cc); - story.getMeta().setWords(words); i++; } + + story.getMeta().setWords(words); pgChaps.setName("Extracting chapters"); pgChaps.done();