[mangadex] fix 'RuntimeError' for titles without a 'description' (#8389)
fixes regression introduced in 0a76cbc8c7
This commit is contained in:
@@ -450,13 +450,13 @@ def _manga_info(self, uuid):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
"manga" : (mattr["title"].get("en") or
|
"manga" : (mattr["title"].get("en") or
|
||||||
next(iter(mattr["title"].values()))),
|
next(iter(mattr["title"].values()), "")),
|
||||||
"manga_id": manga["id"],
|
"manga_id": manga["id"],
|
||||||
"manga_titles": [t.popitem()[1]
|
"manga_titles": [t.popitem()[1]
|
||||||
for t in mattr.get("altTitles") or ()],
|
for t in mattr.get("altTitles") or ()],
|
||||||
"manga_date" : text.parse_datetime(mattr.get("createdAt")),
|
"manga_date" : text.parse_datetime(mattr.get("createdAt")),
|
||||||
"description" : (mattr["description"].get("en") or
|
"description" : (mattr["description"].get("en") or
|
||||||
next(iter(mattr["description"].values()))),
|
next(iter(mattr["description"].values()), "")),
|
||||||
"demographic": mattr.get("publicationDemographic"),
|
"demographic": mattr.get("publicationDemographic"),
|
||||||
"origin": mattr.get("originalLanguage"),
|
"origin": mattr.get("originalLanguage"),
|
||||||
"status": mattr.get("status"),
|
"status": mattr.get("status"),
|
||||||
|
|||||||
@@ -178,6 +178,15 @@ __tests__ = (
|
|||||||
"#count" : ">= 20",
|
"#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",
|
"#url" : "https://mangadex.org/titles/feed",
|
||||||
"#class" : mangadex.MangadexFeedExtractor,
|
"#class" : mangadex.MangadexFeedExtractor,
|
||||||
|
|||||||
Reference in New Issue
Block a user