X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsearchable%2FBasicSearchable.java;h=b943abd25401f426bad456140eea004be06437fb;hp=a67d2f6022e47088824d7f61cbaaa341b6ce8a0c;hb=d66deb8d8b30cff6b54db352eef34a3508939f84;hpb=b31a0db030e164bc1d9a8620e71b595dad31adb6 diff --git a/src/be/nikiroo/fanfix/searchable/BasicSearchable.java b/src/be/nikiroo/fanfix/searchable/BasicSearchable.java index a67d2f6..b943abd 100644 --- a/src/be/nikiroo/fanfix/searchable/BasicSearchable.java +++ b/src/be/nikiroo/fanfix/searchable/BasicSearchable.java @@ -131,6 +131,20 @@ public abstract class BasicSearchable { */ abstract public int searchPages(String search) throws IOException; + /** + * Search for the given tag and return the number of pages of results of + * stories satisfying this tag. + * + * @param tag + * the tag to search for + * + * @return a number of pages + * + * @throws IOException + * in case of I/O error + */ + abstract public int searchPages(SearchableTag tag) throws IOException; + /** * Search for the given term and return a list of stories satisfying this * search term. @@ -208,8 +222,7 @@ public abstract class BasicSearchable { * in case of I/O error */ protected Document load(URL url, boolean stable) throws IOException { - return DataUtil.load(Instance.getCache().open(url, support, stable), - "UTF-8", url.toString()); + return DataUtil.load(Instance.getInstance().getCache().open(url, support, stable), "UTF-8", url.toString()); } /** @@ -233,7 +246,7 @@ public abstract class BasicSearchable { case FANFICTION: support = new Fanfiction(type); break; - case MANGAFOX: + case MANGAHUB: // TODO break; case E621: