From 92b38ac04267e3060d5e1a70366eec9108567ebd Mon Sep 17 00:00:00 2001 From: kooper100 Date: Tue, 9 Jan 2024 20:54:17 -0500 Subject: [PATCH] Updated parsing of manga title from URL. --- src/en/madokami/build.gradle | 2 +- .../src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/en/madokami/build.gradle b/src/en/madokami/build.gradle index 41b27fab..d98ab9ca 100644 --- a/src/en/madokami/build.gradle +++ b/src/en/madokami/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Madokami' pkgNameSuffix = 'en.madokami' extClass = '.Madokami' - extVersionCode = 7 + extVersionCode = 8 } apply from: "$rootDir/common.gradle" diff --git a/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt b/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt index 354562e7..5c4b43ef 100644 --- a/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt +++ b/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt @@ -67,7 +67,9 @@ class Madokami : ConfigurableSource, ParsedHttpSource() { override fun popularMangaFromElement(element: Element): SManga { val manga = SManga.create() manga.url = element.attr("href") - manga.title = URLDecoder.decode(element.attr("href").split("/").last(), "UTF-8").trimStart('!') + val pathSegments = element.attr("href").split("/") + var i = pathSegments.size + do { i--; manga.title = URLDecoder.decode(pathSegments[i], "UTF-8") } while (URLDecoder.decode(pathSegments[i], "UTF-8").startsWith("!")) return manga }