X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Flibrary%2FWebLibraryServer.java;h=3e2c90605de78b2956290b4b36b56bb8a6a42688;hp=a59fa3456d3d294b7614db718eaacadadb2d4415;hb=c5103223c48d55a178f30e972313b009d8f79056;hpb=28b6ea54709eeb435a00edea59db10b02acd431a diff --git a/src/be/nikiroo/fanfix/library/WebLibraryServer.java b/src/be/nikiroo/fanfix/library/WebLibraryServer.java index a59fa34..3e2c906 100644 --- a/src/be/nikiroo/fanfix/library/WebLibraryServer.java +++ b/src/be/nikiroo/fanfix/library/WebLibraryServer.java @@ -655,6 +655,7 @@ public class WebLibraryServer implements Runnable { // /story/luid/chapter/para <-- text/image // /story/luid/cover <-- image // /story/luid/metadata <-- json + // /story/luid/json <-- json, whole chapter (no images) private Response getStoryPart(String uri, List whitelist) { String[] cover = uri.split("/"); int off = 2; @@ -671,7 +672,7 @@ public class WebLibraryServer implements Runnable { // 1-based (0 = desc) int chapter = 0; if (chapterStr != null && !"cover".equals(chapterStr) - && !"metadata".equals(chapterStr)) { + && !"metadata".equals(chapterStr) && !"json".equals(chapterStr)) { try { chapter = Integer.parseInt(chapterStr); if (chapter < 0) { @@ -710,6 +711,11 @@ public class WebLibraryServer implements Runnable { JSONObject json = JsonIO.toJson(meta); mimeType = "application/json"; in = new ByteArrayInputStream(json.toString().getBytes()); + } else if ("json".equals(chapterStr)) { + Story story = story(luid, whitelist); + JSONObject json = JsonIO.toJson(story); + mimeType = "application/json"; + in = new ByteArrayInputStream(json.toString().getBytes()); } else { Story story = story(luid, whitelist); if (story != null) {