Properly process chapters without a group name (#8785)

* Fixed MangaDex content rating preferences being swapped

* Properly process anonymous chapters

* Remembered to account for empty string
This commit is contained in:
loocool2 2021-08-24 07:55:26 -07:00 committed by GitHub
parent 08246bf4e8
commit f77b170e45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'MangaDex'
pkgNameSuffix = 'all.mangadex'
extClass = '.MangaDexFactory'
extVersionCode = 128
extVersionCode = 129
libVersion = '1.2'
containsNsfw = true
}

View File

@ -170,7 +170,7 @@ class MangaDexHelper() {
return SManga.create().apply {
url = "/manga/${mangaDto.data.id}"
title = cleanString(mangaDto.data.attributes.title.asMdMap()["en"] ?: "")
coverFileName?.let {
thumbnail_url = when(coverSuffix != null && coverSuffix != "") {
true -> "${MDConstants.cdnUrl}/covers/${mangaDto.data.id}/$coverFileName$coverSuffix"
@ -260,6 +260,8 @@ class MangaDexHelper() {
)
}.mapNotNull { it.attributes!!.name }
.joinToString(" & ")
.replace("no group", "No Group")
.ifEmpty { "No Group" }
val chapterName = mutableListOf<String>()
// Build chapter name
@ -289,6 +291,7 @@ class MangaDexHelper() {
if (chapterName.isEmpty()) {
chapterName.add("Oneshot")
}
// In future calculate [END] if non mvp api doesnt provide it
return SChapter.create().apply {