FMReader: remove manga title from chapter names (#3421)
* FMReader: remove manga title from chaper names * FMReader: throw exception for unreachable code * FMReader: increase extVersionCode, comment out logs * FMReader: retain the original futionality of chapterFromElement() * FMReader: some final touches
This commit is contained in:
parent
6df012ed41
commit
bf3e4e4ddb
|
@ -5,7 +5,7 @@ ext {
|
|||
appName = 'Tachiyomi: FMReader (multiple aggregators)'
|
||||
pkgNameSuffix = 'all.fmreader'
|
||||
extClass = '.FMReaderFactory'
|
||||
extVersionCode = 15
|
||||
extVersionCode = 16
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -171,17 +171,27 @@ abstract class FMReader(
|
|||
}
|
||||
}
|
||||
|
||||
override fun chapterListParse(response: Response): List<SChapter> {
|
||||
val document = response.asJsoup()
|
||||
val mangaTitle = document.select(".manga-info h1").text()
|
||||
return document.select(chapterListSelector()).map { chapterFromElement(it, mangaTitle) }.distinctBy { it.url }
|
||||
}
|
||||
|
||||
override fun chapterFromElement(element: Element): SChapter {
|
||||
return chapterFromElement(element, "")
|
||||
}
|
||||
|
||||
override fun chapterListSelector() = "div#list-chapters p, table.table tr"
|
||||
|
||||
open val chapterUrlSelector = "a"
|
||||
|
||||
open val chapterTimeSelector = "time"
|
||||
|
||||
override fun chapterFromElement(element: Element): SChapter {
|
||||
open fun chapterFromElement(element: Element, mangaTitle: String = ""): SChapter {
|
||||
return SChapter.create().apply {
|
||||
element.select(chapterUrlSelector).first().let {
|
||||
setUrlWithoutDomain(it.attr("abs:href"))
|
||||
name = it.text()
|
||||
name = it.text().substringAfter("$mangaTitle ")
|
||||
}
|
||||
date_upload = element.select(chapterTimeSelector).let { if (it.hasText()) parseChapterDate(it.text()) else 0 }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue