Use a empty title if none is found
This commit is contained in:
parent
a856ea20b4
commit
866c4a77a3
@ -56,7 +56,7 @@ class ApiMangaParser(
|
|||||||
try {
|
try {
|
||||||
val mangaAttributesDto = mangaDto.data.attributes
|
val mangaAttributesDto = mangaDto.data.attributes
|
||||||
mdUuid = mangaDto.data.id
|
mdUuid = mangaDto.data.id
|
||||||
title = MdUtil.cleanString(mangaAttributesDto.title.asMdMap().let { it[lang] ?: it["en"]!! })
|
title = MdUtil.cleanString(mangaAttributesDto.title.asMdMap().let { it[lang] ?: it["en"].orEmpty() })
|
||||||
altTitles = mangaAttributesDto.altTitles.mapNotNull { it[lang] }.nullIfEmpty()
|
altTitles = mangaAttributesDto.altTitles.mapNotNull { it[lang] }.nullIfEmpty()
|
||||||
|
|
||||||
mangaDto.relationships
|
mangaDto.relationships
|
||||||
|
@ -265,7 +265,7 @@ class MdUtil {
|
|||||||
fun createMangaEntry(json: MangaDto, lang: String): MangaInfo {
|
fun createMangaEntry(json: MangaDto, lang: String): MangaInfo {
|
||||||
return MangaInfo(
|
return MangaInfo(
|
||||||
key = buildMangaUrl(json.data.id),
|
key = buildMangaUrl(json.data.id),
|
||||||
title = cleanString(json.data.attributes.title.asMdMap().let { it[lang] ?: it["en"]!! }),
|
title = cleanString(json.data.attributes.title.asMdMap().let { it[lang] ?: it["en"].orEmpty() }),
|
||||||
cover = json.relationships
|
cover = json.relationships
|
||||||
.firstOrNull { relationshipDto -> relationshipDto.type == MdConstants.Types.coverArt }
|
.firstOrNull { relationshipDto -> relationshipDto.type == MdConstants.Types.coverArt }
|
||||||
?.attributes
|
?.attributes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user