Dynasty scan fixes
fix not able to set covers for chapters give default cover for chapters fix duplicate genre tags
This commit is contained in:
parent
29b8a55b4c
commit
0d022893f6
|
@ -5,8 +5,8 @@ ext {
|
|||
appName = 'Tachiyomi: Dynasty'
|
||||
pkgNameSuffix = "en.dynasty"
|
||||
extClass = '.DynastyFactory'
|
||||
extVersionCode = 4
|
||||
extVersionSuffix = 4
|
||||
extVersionCode = 5
|
||||
extVersionSuffix = 5
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,11 @@ class DynastyChapters : DynastyScans() {
|
|||
}
|
||||
|
||||
|
||||
override fun mangaDetailsParse(document: Document): SManga = SManga.create()
|
||||
override fun mangaDetailsParse(document: Document): SManga {
|
||||
val manga = SManga.create()
|
||||
manga.thumbnail_url = document.select("img")[2].absUrl("src")
|
||||
return manga
|
||||
}
|
||||
|
||||
override fun searchMangaSelector() = "dd"
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ abstract class DynastyScans : ParsedHttpSource() {
|
|||
|
||||
override fun popularMangaRequest(page: Int): Request {
|
||||
return GET(popularMangaInitialUrl(), headers)
|
||||
}
|
||||
}
|
||||
|
||||
override fun popularMangaSelector() = "ul.thumbnails > li.span2"
|
||||
|
||||
|
@ -100,22 +100,16 @@ abstract class DynastyScans : ParsedHttpSource() {
|
|||
return true
|
||||
}
|
||||
|
||||
protected fun parseGenres(document: Document, manga: SManga, select: String = "div.tags > div.tag-tags") {
|
||||
manga.genre = ""
|
||||
val glist = document.select(select).first().getElementsByTag("a")
|
||||
parseGenres(glist, manga)
|
||||
if (!glist.isEmpty()) {
|
||||
for (g in glist) {
|
||||
val s = g.text()
|
||||
manga.genre += if (glist.last() == (g)) s else "$s, "
|
||||
}
|
||||
}
|
||||
protected fun parseGenres(document: Document, manga: SManga, select: String = "div.tags > div.tag-tags a") {
|
||||
parseGenres(document.select(select), manga)
|
||||
}
|
||||
|
||||
protected fun parseGenres(elements: Elements, manga: SManga) {
|
||||
if (!elements.isEmpty()) {
|
||||
var genres = mutableListOf<String>()
|
||||
elements?.forEach { genres.add(it.text()) }
|
||||
elements?.forEach {
|
||||
genres.add(it.text())
|
||||
}
|
||||
manga.genre = genres.joinToString(", ")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue