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

Commit 1c3d65d

Browse files
authored
Merge pull request #22 from hkalexling/fix/mangadex-non-english-title
Correctly handle manga without English titles
2 parents 0a1d45d + acd69d7 commit 1c3d65d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/mangadex/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ function searchManga(query) {
5454
mango.raise('Failed to search for manga.');
5555

5656
return JSON.stringify(manga.map(function(m) {
57+
const titleAttr = m.attributes.title;
5758
const ch = {
5859
id: m.id,
59-
title: m.attributes.title.en,
60+
title: titleAttr.en || titleAttr['ja-ro'] || titleAttr[Object.keys(titleAttr)[0]]
6061
};
6162
for (i = 0; i < m.relationships.length; i++) {
6263
const obj = m.relationships[i];

0 commit comments

Comments
 (0)