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:
Aria Moradi 2020-06-08 03:54:12 +04:30 committed by GitHub
parent 6df012ed41
commit bf3e4e4ddb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: FMReader (multiple aggregators)' appName = 'Tachiyomi: FMReader (multiple aggregators)'
pkgNameSuffix = 'all.fmreader' pkgNameSuffix = 'all.fmreader'
extClass = '.FMReaderFactory' extClass = '.FMReaderFactory'
extVersionCode = 15 extVersionCode = 16
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -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" override fun chapterListSelector() = "div#list-chapters p, table.table tr"
open val chapterUrlSelector = "a" open val chapterUrlSelector = "a"
open val chapterTimeSelector = "time" open val chapterTimeSelector = "time"
override fun chapterFromElement(element: Element): SChapter { open fun chapterFromElement(element: Element, mangaTitle: String = ""): SChapter {
return SChapter.create().apply { return SChapter.create().apply {
element.select(chapterUrlSelector).first().let { element.select(chapterUrlSelector).first().let {
setUrlWithoutDomain(it.attr("abs:href")) 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 } date_upload = element.select(chapterTimeSelector).let { if (it.hasText()) parseChapterDate(it.text()) else 0 }
} }