X-Git-Url: http://git.nikiroo.be/?p=fanfix.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FBasicSupport.java;h=ff9ecaf9be3cc80666d964ee48da375d1307bae6;hp=f1635589bfd70b0dca80b5972dcfd241bda895f8;hb=ee8686f095023b8cde2fc33488a58c291acfc50a;hpb=509c7ce173c9d2f607cca22799d66ddb24a9aa29 diff --git a/src/be/nikiroo/fanfix/supported/BasicSupport.java b/src/be/nikiroo/fanfix/supported/BasicSupport.java index f163558..ff9ecaf 100644 --- a/src/be/nikiroo/fanfix/supported/BasicSupport.java +++ b/src/be/nikiroo/fanfix/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; @@ -271,7 +272,14 @@ public abstract class BasicSupport { pg.setProgress(30); Story story = new Story(); + MetaData meta = getMeta(); + 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 @@ -347,6 +355,8 @@ public abstract class BasicSupport { scan.useDelimiter("\0"); try { return new JSONObject(scan.next()); + } catch (JSONException e) { + throw new IOException(e); } finally { scan.close(); }