[mangadex] fix 'RuntimeError' for titles without a 'description' (#8389)

fixes regression introduced in 0a76cbc8c7
This commit is contained in:
Mike Fährmann
2025-10-11 15:06:26 +02:00
parent 11706d1e42
commit 214acc39e6
2 changed files with 11 additions and 2 deletions

View File

@@ -450,13 +450,13 @@ def _manga_info(self, uuid):
return {
"manga" : (mattr["title"].get("en") or
next(iter(mattr["title"].values()))),
next(iter(mattr["title"].values()), "")),
"manga_id": manga["id"],
"manga_titles": [t.popitem()[1]
for t in mattr.get("altTitles") or ()],
"manga_date" : text.parse_datetime(mattr.get("createdAt")),
"description" : (mattr["description"].get("en") or
next(iter(mattr["description"].values()))),
next(iter(mattr["description"].values()), "")),
"demographic": mattr.get("publicationDemographic"),
"origin": mattr.get("originalLanguage"),
"status": mattr.get("status"),

View File

@@ -178,6 +178,15 @@ __tests__ = (
"#count" : ">= 20",
},
{
"#url" : "https://mangadex.org/title/2e73a1ac-bf26-4c04-84f6-d0a22fd37624/tomodachi-no-joshi-ni-josou-saserare-danshi",
"#comment" : "no 'description' (#8389)",
"#class" : mangadex.MangadexMangaExtractor,
"#count" : 47,
"description": "",
},
{
"#url" : "https://mangadex.org/titles/feed",
"#class" : mangadex.MangadexFeedExtractor,