1+ const QUERY_PARAMS = 'contentRating[]=safe&contentRating[]=suggestive&contentRating[]=erotica&contentRating[]=pornographic&' ;
2+
13function 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
4850function 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
103105function 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