git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update from master
[fanfix.git]
/
supported
/
BasicSupport.java
diff --git
a/supported/BasicSupport.java
b/supported/BasicSupport.java
index 17cbec5a984b59c5af1e053aefabdccb2e120140..ff9ecaf9be3cc80666d964ee48da375d1307bae6 100644
(file)
--- 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 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;
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();
pg.setProgress(30);
Story story = new Story();
+
MetaData meta = getMeta();
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
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());
scan.useDelimiter("\0");
try {
return new JSONObject(scan.next());
+ } catch (JSONException e) {
+ throw new IOException(e);
} finally {
scan.close();
}
} finally {
scan.close();
}
@@
-384,6
+394,7
@@
public abstract class BasicSupport {
resume.setName("");
resume.setNumber(1);
story.getChapters().add(resume);
resume.setName("");
resume.setNumber(1);
story.getChapters().add(resume);
+ story.getMeta().setWords(resume.getWords());
String descChapterName = Instance.getInstance().getTrans()
.getString(StringId.DESCRIPTION);
String descChapterName = Instance.getInstance().getTrans()
.getString(StringId.DESCRIPTION);
@@
-431,7
+442,7
@@
public abstract class BasicSupport {
story.setChapters(new ArrayList<Chapter>());
List<Entry<String, URL>> chapters = getChapters(pgGetChapters);
pgGetChapters.done(); // 20%
story.setChapters(new ArrayList<Chapter>());
List<Entry<String, URL>> chapters = getChapters(pgGetChapters);
pgGetChapters.done(); // 20%
-
+
if (chapters != null) {
Progress pgChaps = new Progress("Extracting chapters", 0,
chapters.size() * 300);
if (chapters != null) {
Progress pgChaps = new Progress("Extracting chapters", 0,
chapters.size() * 300);
@@
-462,10
+473,11
@@
public abstract class BasicSupport {
words += cc.getWords();
story.getChapters().add(cc);
words += cc.getWords();
story.getChapters().add(cc);
- story.getMeta().setWords(words);
i++;
}
i++;
}
+
+ story.getMeta().setWords(words);
pgChaps.setName("Extracting chapters");
pgChaps.done();
pgChaps.setName("Extracting chapters");
pgChaps.done();