Updated parsing of manga title from URL.

This commit is contained in:
kooper100 2024-01-09 20:54:17 -05:00
parent f5395f23bb
commit 92b38ac042
2 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Madokami' extName = 'Madokami'
pkgNameSuffix = 'en.madokami' pkgNameSuffix = 'en.madokami'
extClass = '.Madokami' extClass = '.Madokami'
extVersionCode = 7 extVersionCode = 8
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -67,7 +67,9 @@ class Madokami : ConfigurableSource, ParsedHttpSource() {
override fun popularMangaFromElement(element: Element): SManga { override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create() val manga = SManga.create()
manga.url = element.attr("href") 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 return manga
} }