protected abstract String getDesc() throws IOException;
/**
- * Return the list of chapters (name and resource). *
+ * Return the list of chapters (name and resource).
* <p>
* Can be NULL if this {@link BasicSupport} do no use chapters.
*
setCurrentReferer(null);
}
- /**
- * Process the given story resource into a partially filled {@link Story}
- * object containing the name and metadata, except for the description.
- *
- * @return the {@link Story}
- *
- * @throws IOException
- * in case of I/O error
- */
- public final Story processMeta() throws IOException {
- Story story = null;
-
- try {
- story = processMeta(false, null);
- } finally {
- close();
- }
-
- return story;
- }
-
/**
* Process the given story resource into a partially filled {@link Story}
* object containing the name and metadata.
getDesc(), isHtml(), null));
}
- pg.setProgress(100);
+ pg.done();
return story;
}
/**
- * Actual processing step, without the calls to other methods.
- * <p>
- * Will convert the story resource into a fully filled {@link Story} object.
+ * Process the given story resource into a fully filled {@link Story}
+ * object.
*
* @param pg
* the optional progress reporter
* @throws IOException
* in case of I/O error
*/
- // TODO: add final
+ // ADD final when BasicSupport_Deprecated is gone
public Story process(Progress pg) throws IOException {
setCurrentReferer(source);
login();
}
/**
- * Process the given story resource into a fully filled {@link Story}
- * object.
+ * Actual processing step, without the calls to other methods.
+ * <p>
+ * Will convert the story resource into a fully filled {@link Story} object.
*
* @param pg
* the optional progress reporter
* @throws IOException
* in case of I/O error
*/
- public Story doProcess(Progress pg) throws IOException {
+ protected Story doProcess(Progress pg) throws IOException {
if (pg == null) {
pg = new Progress();
} else {
Progress pgMeta = new Progress();
pg.addProgress(pgMeta, 10);
Story story = processMeta(true, pgMeta);
- if (!pgMeta.isDone()) {
- pgMeta.setProgress(pgMeta.getMax()); // 10%
- }
+ pgMeta.done(); // 10%
pg.setName("Retrieving " + story.getMeta().getTitle());
pg.addProgress(pgGetChapters, 10);
story.setChapters(new ArrayList<Chapter>());
List<Entry<String, URL>> chapters = getChapters(pgGetChapters);
- if (!pgGetChapters.isDone()) {
- pgGetChapters.setProgress(pgGetChapters.getMax()); // 20%
- }
+ pgGetChapters.done(); // 20%
if (chapters != null) {
Progress pgChaps = new Progress("Extracting chapters", 0,
String content = getChapterContent(chapUrl, i,
pgGetChapterContent);
- if (!pgGetChapterContent.isDone()) {
- pgGetChapterContent.setProgress(pgGetChapterContent
- .getMax());
- }
-
+ pgGetChapterContent.done();
Chapter cc = BasicSupportPara.makeChapter(this, chapUrl, i,
chapName, content, isHtml(), pgMakeChapter);
- if (!pgMakeChapter.isDone()) {
- pgMakeChapter.setProgress(pgMakeChapter.getMax());
- }
+ pgMakeChapter.done();
words += cc.getWords();
story.getChapters().add(cc);
}
pgChaps.setName("Extracting chapters");
- } else {
- pg.setProgress(80);
+ pgChaps.done();
}
+ pg.done();
+
return story;
}
case E_HENTAI:
support = new EHentai();
break;
+ case MANGA_LEL:
+ support = new MangaLel();
+ break;
case CBZ:
support = new Cbz();
break;