Commit 781c14df authored by Duhoux Pierre-Louis's avatar Duhoux Pierre-Louis

Add fromback to mangarock to allow AMR to load data in background

parent 166776e4
......@@ -8,7 +8,8 @@ if (typeof registerMangaObject === 'function') {
home: "https://mangarock.com/",
chapter_url: /\/manga\/.*\/chapter\/.*/g,
api: "https://api.mangarockhd.com/query/web401/",
fromback: ["infos", "images"],
getMangaList: async function (search) {
let json = await amr.loadJson(
this.api + "mrs_quick_search",
......@@ -52,8 +53,7 @@ if (typeof registerMangaObject === 'function') {
if (choid.indexOf("#") > 0) choid = choid.substr(0, choid.indexOf("#"));
let res = {};
let manga = await amr.loadJson(this.api + "info?oid=" + oid, { nocache: true })
res.name = manga.data.name;
res.name = manga && manga.data ? manga.data.name : "Unknown";
res.currentMangaURL = "https://mangarock.com/manga/" + oid;
res.currentChapterURL = "https://mangarock.com/manga/" + oid + "/chapter/" + choid;
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