Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Commit

Permalink
added +- filter to neumangatv
Browse files Browse the repository at this point in the history
  • Loading branch information
raulhaag committed Aug 20, 2019
1 parent 3071469 commit 9991793
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions app/src/main/java/ar/rulosoft/mimanganu/servers/NeuMangaTv.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public String getImageFrom(Chapter chapter, int page) throws Exception {
String web = HOST + chapter.getPath() + "/" + page;
String data = getNavigatorAndFlushParameters().get(web);
web = getFirstMatch(PATTERN_CHAPTER_IMAGE, data, "can't find image");
web = web.replaceAll("([^:])//", "$1/"); // remove consecutive slashes
web = web.replaceAll("([^:])//", "$1/"); // remove consecutive slashes
return web + "|" + HOST + chapter.getPath();
}

Expand All @@ -124,17 +124,29 @@ public void chapterInit(Chapter chapter) throws Exception {
public ArrayList<Manga> getMangasFiltered(int[][] filters, int pageNumber) throws Exception {
StringBuilder web = new StringBuilder(HOST);
web.append("/advanced_search?name_search_mode=contain&name_search_query=&artist_search_mode=contain&artist_search_query=&author_search_mode=contain&author_search_query=&genre0=%5B%5D&genre1=%5B");
if (filters[0].length > 0) {
for (int i = 0; i < filters[0].length - 1; i++) {

for (int i = 0; i < filters[0].length; i++) {
if (filters[0][i] == 1) {
web.append("%22");
web.append(genres[filters[0][i]]);
web.append(genres[i]);
web.append("%22%2C");
}
web.append("%22");
web.append(genres[filters[0][filters[0].length - 1]]);
web.append("%22");
}
web.append("%5D&genre2=%5B%5D&year_search_mode=on&year_value=&rating_search_mode=is&rating_value=&manga_status=&advpage=");
if (web.substring(web.length() - 3, web.length()).equals("%2C")) {
web.delete(web.length() - 3, web.length());
}
web.append("%5D&genre2=%5B");
for (int i = 0; i < filters[0].length; i++) {
if (filters[0][i] == -1) {
web.append("%22");
web.append(genres[i]);
web.append("%22%2C");
}
}
if (web.substring(web.length() - 3, web.length()).equals("%2C")) {
web.delete(web.length() - 3, web.length());
}
web.append("%5D&year_search_mode=on&year_value=&rating_search_mode=is&rating_value=&manga_status=&advpage=");
web.append(pageNumber);
web.append("&sortby=");
web.append(sortByValues[filters[1][0]]);
Expand All @@ -157,7 +169,7 @@ public ServerFilter[] getServerFilters() {
return new ServerFilter[]{
new ServerFilter(
context.getString(R.string.flt_genre), genres
, ServerFilter.FilterType.MULTI),
, ServerFilter.FilterType.MULTI_STATES),
new ServerFilter(
context.getString(R.string.flt_order_by), sortBy
, ServerFilter.FilterType.SINGLE),
Expand Down

0 comments on commit 9991793

Please sign in to comment.