Commit 43356f83 authored by dhomo's avatar dhomo

fix for not latin symbols in search in request

and
filter all non manga in response
parent a6d5075c
...@@ -10,12 +10,20 @@ if (typeof registerMangaObject === "function") { ...@@ -10,12 +10,20 @@ if (typeof registerMangaObject === "function") {
getMangaList: async function (search) { getMangaList: async function (search) {
let json = await amr.loadJson( let json = await amr.loadJson(
"http://readmanga.me/search/suggestion?query=" + search, "http://readmanga.me/search/suggestion",
{ nocache: true, preventimages: true } {
nocache: true,
preventimages: true,
type: 'GET',
dataType: "text",
data: { query: search }
}
) )
let res = []; let res = [];
for (let sug of json.suggestions) { for (let sug of json.suggestions) {
res[res.length] = [sug.value, "http://readmanga.me" + sug.link] if (!sug.link.includes("/", 1)) {
res[res.length] = [sug.value, "http://readmanga.me" + sug.link]
}
} }
return res return res
}, },
......
...@@ -10,12 +10,20 @@ if (typeof registerMangaObject === "function") { ...@@ -10,12 +10,20 @@ if (typeof registerMangaObject === "function") {
getMangaList: async function (search) { getMangaList: async function (search) {
let json = await amr.loadJson( let json = await amr.loadJson(
"http://mintmanga.com/search/suggestion?query=" + search, "http://mintmanga.com/search/suggestion",
{ nocache: true, preventimages: true } {
nocache: true,
preventimages: true,
type: 'GET',
dataType: "text",
data: { query: search }
}
) )
let res = []; let res = [];
for (let sug of json.suggestions) { for (let sug of json.suggestions) {
res[res.length] = [sug.value, "http://mintmanga.com" + sug.link] if (!sug.link.includes("/", 1)) {
res[res.length] = [sug.value, "http://mintmanga.com" + sug.link]
}
} }
return res return res
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment