return getStories(url, null, null);
}
- @Override
- public int searchPages(String search) throws IOException {
- String encoded = URLEncoder.encode(search.toLowerCase(), "utf-8");
- String url = BASE_URL + "search/?ready=1&type=story&keywords="
- + encoded;
-
- return getPages(load(url, false));
- }
-
@Override
public List<MetaData> search(SearchableTag tag, int page)
throws IOException {
return metas;
}
+ @Override
+ public int searchPages(String search) throws IOException {
+ String encoded = URLEncoder.encode(search.toLowerCase(), "utf-8");
+ String url = BASE_URL + "search/?ready=1&type=story&keywords="
+ + encoded;
+
+ return getPages(load(url, false));
+ }
+
+ @Override
+ public int searchPages(SearchableTag tag) throws IOException {
+ if (tag.isLeaf()) {
+ String url = tag.getId();
+ return getPages(load(url, false));
+ }
+
+ return 0;
+ }
+
/**
* Return the number of pages in this stories result listing.
*
String coverUrl = cover.absUrl("src");
try {
- InputStream in = Instance.getCache().open(
- new URL(coverUrl), getSupport(), true);
+ InputStream in = Instance.getInstance().getCache().open(new URL(coverUrl), getSupport(), true);
try {
meta.setCover(new Image(in));
} finally {
}
} catch (Exception e) {
// Should not happen on Fanfiction.net
- Instance.getTraceHandler().error(
- new Exception(
- "Cannot download cover for Fanfiction story in search mode: "
- + meta.getTitle(), e));
+ Instance.getInstance().getTraceHandler().error(new Exception(
+ "Cannot download cover for Fanfiction story in search mode: " + meta.getTitle(), e));
}
}
}
}
meta.setResume(getSupport().makeChapter(new URL(sourceUrl), 0,
- Instance.getTrans().getString(StringId.DESCRIPTION),
- resume));
+ Instance.getInstance().getTrans().getString(StringId.DESCRIPTION), resume));
}
// How are the tags ordered?