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

Commit

Permalink
Added letter filter japscan and changed to .co
Browse files Browse the repository at this point in the history
  • Loading branch information
raulhaag committed Sep 30, 2019
1 parent ff26354 commit 1662fb6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
20 changes: 18 additions & 2 deletions app/src/main/java/ar/rulosoft/mimanganu/servers/JapScan.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import ar.rulosoft.mimanganu.R;
import ar.rulosoft.mimanganu.componentes.Chapter;
import ar.rulosoft.mimanganu.componentes.Manga;
import ar.rulosoft.mimanganu.componentes.ServerFilter;
import ar.rulosoft.navegadores.Navigator;

import static ar.rulosoft.mimanganu.utils.PostProcess.FLAG_PPL90;
Expand All @@ -23,7 +24,7 @@
*/
class JapScan extends ServerBase {

private static final String HOST = "https://www.japscan.to";
private static final String HOST = "https://www.japscan.co";

JapScan(Context context) {
super(context);
Expand All @@ -33,6 +34,9 @@ class JapScan extends ServerBase {
setServerID(JAPSCAN);
}

private String[] letterFilter = new String[]{"All", "0-9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};

@Override
public boolean hasList() {
return false;
Expand Down Expand Up @@ -133,10 +137,22 @@ private ArrayList<Manga> getMangasFromSource(String source) {

@Override
public synchronized ArrayList<Manga> getMangasFiltered(int[][] filters, int pageNumber) throws Exception {
String source = getNavigatorAndFlushParameters().get(HOST + "/mangas/" + pageNumber);
String extra = "";
if (filters[0][0] != 0) {
extra = letterFilter[filters[0][0]] + "/";
}
String source = getNavigatorAndFlushParameters().get(HOST + "/mangas/" + extra + pageNumber);
return getMangasFromSource(source);
}


@Override
public ServerFilter[] getServerFilters() {
return new ServerFilter[]{
new ServerFilter(context.getString(R.string.flt_alpha), letterFilter, ServerFilter.FilterType.SINGLE),
};
}

@Override
public boolean needRefererForImages() {
return false;
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -503,5 +503,6 @@
<string name="vault_is_empty">Vault is empty.</string>
<string name="run_test">Run server tests.</string>
<string name="run_test_summary">Basic test over servers.</string>
<string name="flt_alpha">Alphabet filter</string>

</resources>

0 comments on commit 1662fb6

Please sign in to comment.