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:
Carlos 2018-03-04 16:19:06 -05:00 committed by GitHub
parent 29b8a55b4c
commit 0d022893f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 15 deletions

View File

@ -5,8 +5,8 @@ ext {
appName = 'Tachiyomi: Dynasty'
pkgNameSuffix = "en.dynasty"
extClass = '.DynastyFactory'
extVersionCode = 4
extVersionSuffix = 4
extVersionCode = 5
extVersionSuffix = 5
libVersion = '1.2'
}

View File

@ -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"

View File

@ -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(", ")
}
}