ScanManga: add scanlators to chapter list (#6491)

This commit is contained in:
Julien Papasian 2021-04-10 12:48:36 +01:00 committed by GitHub
parent 277ca48f99
commit 0e39cec5b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Scan-Manga' extName = 'Scan-Manga'
pkgNameSuffix = 'fr.scanmanga' pkgNameSuffix = 'fr.scanmanga'
extClass = '.ScanManga' extClass = '.ScanManga'
extVersionCode = 3 extVersionCode = 4
libVersion = '1.2' libVersion = '1.2'
containsNsfw = true containsNsfw = true
} }

View File

@ -12,6 +12,7 @@ import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Headers import okhttp3.Headers
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
@ -175,12 +176,17 @@ class ScanManga : ParsedHttpSource() {
} }
// Chapters // Chapters
override fun chapterListSelector() = "div.texte_volume_manga ul li.chapitre div.chapitre_nom a" override fun chapterListSelector() = throw Exception("Not used")
override fun chapterFromElement(element: Element): SChapter = throw Exception("Not used")
override fun chapterListParse(response: Response): List<SChapter> {
val document = response.asJsoup()
override fun chapterFromElement(element: Element): SChapter { return document.select("div.texte_volume_manga ul li.chapitre div.chapitre_nom a").map {
return SChapter.create().apply { SChapter.create().apply {
name = element.text() name = it.text()
setUrlWithoutDomain(element.attr("href")) setUrlWithoutDomain(it.attr("href"))
scanlator = document.select("li[itemprop=\"translator\"] a").joinToString { it.text() }
}
} }
} }