Skip to content

Commit

Permalink
Merge pull request #901 from MALSync/MangaPark-#896
Browse files Browse the repository at this point in the history
Manga park #896
  • Loading branch information
henrik9999 committed Sep 28, 2021
2 parents db14c59 + e3e0e01 commit 6f62dee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions src/pages/MangaPark/main.ts
Expand Up @@ -6,13 +6,7 @@ export const MangaPark: pageInterface = {
languages: ['English'],
type: 'manga',
isSyncPage(url) {
if (
(url.split('/')[3] === 'comic' && url.split('/')[6] !== undefined && url.split('/')[6] === 'chapter') ||
(url.split('/')[3] === 'chapter' && url.split('/')[4] !== undefined && url.split('/')[4])
) {
return true;
}
return false;
return Boolean(url.split('/')[3] === 'comic' && url.split('/')[6] !== undefined && j.$('#viewer').length);
},
isOverviewPage(url) {
if (url.split('/')[3] === 'comic' && url.split('/')[4] !== undefined && url.split('/')[4].length > 0) {
Expand All @@ -31,7 +25,10 @@ export const MangaPark: pageInterface = {
return utils.absoluteLink(j.$('h3.nav-title > a').attr('href'), MangaPark.domain);
},
getEpisode(url) {
let string: any = j.$('#select-chapters option:selected').text();
let string: any = j
.$('#select-chapters option:selected, #select-episodes option:selected')
.first()
.text();
let temp = string.match(/(ch\.|chapter)\D?\d+/i);
if (temp !== null) {
string = temp[0];
Expand All @@ -43,13 +40,16 @@ export const MangaPark: pageInterface = {
return NaN;
},
getVolume(url) {
let string: any = j.$('#select-chapters option:selected').text();
let string: any = j
.$('#select-chapters option:selected, #select-episodes option:selected')
.first()
.text();
let temp = string.match(/(vol\.|volume)\D?\d+/i);
if (temp !== null) {
string = temp[0];
temp = string.match(/\d+/);
if (temp !== null) {
return temp[0];
return Number(temp[0]);
}
}
return NaN;
Expand Down
6 changes: 3 additions & 3 deletions src/pages/MangaPark/tests.json
Expand Up @@ -3,13 +3,13 @@
"url": "https://mangapark.net/",
"testCases": [
{
"url": "https://mangapark.net/comic/87224/her-summon/chapter/en/83",
"url": "https://mangapark.net/comic/87224/her-summon/c83-en",
"expected": {
"sync": true,
"title": "Her Summon",
"identifier": "87224",
"overviewUrl": "https://mangapark.net/comic/87224/her-summon",
"nextEpUrl": "https://mangapark.net/comic/87224/her-summon/chapter/en/84",
"nextEpUrl": "https://mangapark.net/comic/87224/her-summon/c84-en",
"episode": 83,
"uiSelector": false
}
Expand All @@ -21,7 +21,7 @@
"title": "Tiger Books",
"identifier": "38239",
"overviewUrl": "https://mangapark.net/comic/38239/tiger-books",
"nextEpUrl": "https://mangapark.net/chapter/3389701",
"nextEpUrl": "https://mangapark.net/comic/38239/tiger-books/i3389701-en-v2-c1",
"episode": 1,
"uiSelector": false
}
Expand Down

0 comments on commit 6f62dee

Please sign in to comment.