From f77b170e450feebfcd64644eb7fc9c4ed8fd4065 Mon Sep 17 00:00:00 2001 From: loocool2 <36128021+loocool2@users.noreply.github.com> Date: Tue, 24 Aug 2021 07:55:26 -0700 Subject: [PATCH] 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 --- src/all/mangadex/build.gradle | 2 +- .../tachiyomi/extension/all/mangadex/MangaDexHelper.kt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/all/mangadex/build.gradle b/src/all/mangadex/build.gradle index 285cc0e81..a8b44ccc9 100644 --- a/src/all/mangadex/build.gradle +++ b/src/all/mangadex/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'MangaDex' pkgNameSuffix = 'all.mangadex' extClass = '.MangaDexFactory' - extVersionCode = 128 + extVersionCode = 129 libVersion = '1.2' containsNsfw = true } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt index f049ca8c6..d74a8e07a 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDexHelper.kt @@ -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() // 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 {