+
+ // no tags for pools
+ private List<String> getTags() {
+ List<String> tags = new ArrayList<String>();
+ if (isSearchOrSet(getSource())) {
+ String str = getTagsFromUrl(getSource());
+ for (String tag : str.split("\\+")) {
+ try {
+ tags.add(URLDecoder.decode(tag.trim(), "UTF-8").trim());
+ } catch (UnsupportedEncodingException e) {
+ }
+ }
+ }
+
+ return tags;
+ }
+
+ private Image getCover() throws IOException {
+ Image image = null;
+ List<Entry<String, URL>> chapters = getChapters(null);
+ if (!chapters.isEmpty()) {
+ URL chap1Url = chapters.get(0).getValue();
+ String imgsChap1 = getChapterContent(chap1Url, 1, null);
+ if (!imgsChap1.isEmpty()) {
+ imgsChap1 = imgsChap1.split("]")[0].substring(1).trim();
+ image = bsImages.getImage(this, new URL(imgsChap1));
+ }
+ }
+
+ return image;
+ }
+
+ // note: will be removed at getCanonicalUrl()
+ private boolean isSetOriginalUrl(URL originalUrl) {
+ return originalUrl.getPath().startsWith("/post_sets/");
+ }
+
+ private boolean isPool(URL url) {
+ return url.getPath().startsWith("/pools/") || url.getPath().startsWith("/pool/show/");
+ }
+
+ // set will be renamed into search by canonical url
+ private boolean isSearchOrSet(URL url) {
+ return
+ // search:
+ (url.getPath().equals("/posts") && url.getQuery().contains("tags="))
+ // or set:
+ || isSetOriginalUrl(url);
+ }