remove name from manga url to keep backwards compat (#202)
* remove name from manga url to keep backwards compat * update build.gradle
This commit is contained in:
parent
4b3883f8b4
commit
97ecf492ea
|
@ -5,8 +5,8 @@ ext {
|
||||||
appName = 'Tachiyomi: MangaDex'
|
appName = 'Tachiyomi: MangaDex'
|
||||||
pkgNameSuffix = "all.mangadex"
|
pkgNameSuffix = "all.mangadex"
|
||||||
extClass = '.MangadexFactory'
|
extClass = '.MangadexFactory'
|
||||||
extVersionCode = 5
|
extVersionCode = 6
|
||||||
extVersionSuffix = 5
|
extVersionSuffix = 6
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,17 +60,19 @@ open class Mangadex(override val lang: String, private val internalLang: String,
|
||||||
override fun popularMangaFromElement(element: Element): SManga {
|
override fun popularMangaFromElement(element: Element): SManga {
|
||||||
val manga = SManga.create()
|
val manga = SManga.create()
|
||||||
element.select("a[href*=manga]").first().let {
|
element.select("a[href*=manga]").first().let {
|
||||||
manga.setUrlWithoutDomain(it.attr("href"))
|
manga.setUrlWithoutDomain(removeMangaNameFromUrl(it.attr("href")))
|
||||||
manga.title = it.text().trim()
|
manga.title = it.text().trim()
|
||||||
manga.author = it?.text()?.trim()
|
manga.author = it?.text()?.trim()
|
||||||
}
|
}
|
||||||
return manga
|
return manga
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun removeMangaNameFromUrl(url: String): String = url.substringBeforeLast("/") + "/"
|
||||||
|
|
||||||
override fun latestUpdatesFromElement(element: Element): SManga {
|
override fun latestUpdatesFromElement(element: Element): SManga {
|
||||||
val manga = SManga.create()
|
val manga = SManga.create()
|
||||||
element.let {
|
element.let {
|
||||||
manga.setUrlWithoutDomain(it.attr("href"))
|
manga.setUrlWithoutDomain(removeMangaNameFromUrl(it.attr("href")))
|
||||||
manga.title = it.text().trim()
|
manga.title = it.text().trim()
|
||||||
}
|
}
|
||||||
return manga
|
return manga
|
||||||
|
|
Loading…
Reference in New Issue