Skip to content
This repository was archived by the owner on Mar 23, 2025. It is now read-only.

Commit 66e0b8c

Browse files
authored
Merge pull request #32 from melyux/mangadexAllTitles
Allow all content from Mangadex
2 parents e0cf022 + 86b9609 commit 66e0b8c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

plugins/mangadex/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const QUERY_PARAMS = 'contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic&';
2+
13
function getCoverURL(mangaId, coverId) {
24
const res = mango.get('https://api.mangadex.org/cover/' + coverId);
35
if (res.status_code !== 200)
@@ -46,7 +48,7 @@ function formatTimestamp(timestamp) {
4648
}
4749

4850
function searchManga(query) {
49-
const res = mango.get('https://api.mangadex.org/manga?title=' + encodeURIComponent(query));
51+
const res = mango.get('https://api.mangadex.org/manga?title=' + encodeURIComponent(query) + '&' + QUERY_PARAMS);
5052
if (res.status_code !== 200)
5153
mango.raise('Failed to search for manga. Status ' + res.status_code);
5254
const manga = JSON.parse(res.body).data;
@@ -75,7 +77,7 @@ function listChapters(id) {
7577
const titleAttr = manga.attributes.title;
7678
const title = titleAttr.en || titleAttr['ja-ro'] || titleAttr[Object.keys(titleAttr)[0]];
7779

78-
var url = 'https://api.mangadex.org/manga/' + id + '/feed?';
80+
var url = 'https://api.mangadex.org/manga/' + id + '/feed?' + QUERY_PARAMS;
7981

8082
const langStr = mango.settings('language');
8183
if (langStr) {
@@ -101,7 +103,7 @@ function listChapters(id) {
101103
}
102104

103105
function newChapters(mangaId, after) {
104-
var url = 'https://api.mangadex.org/manga/' + mangaId + '/feed?publishAtSince=' + formatTimestamp(after) + '&';
106+
var url = 'https://api.mangadex.org/manga/' + mangaId + '/feed?publishAtSince=' + formatTimestamp(after) + '&' + QUERY_PARAMS;
105107

106108
const langStr = mango.settings('language');
107109
if (langStr) {

0 commit comments

Comments
 (0)