[Improvement] TuMangaOnline - Removed dups from latest updates (#1668)
[Improvement] TuMangaOnline - Removed dups from latest updates
This commit is contained in:
parent
a38b2052d7
commit
bae97809f5
|
@ -5,7 +5,7 @@ ext {
|
|||
appName = 'Tachiyomi: TuMangaOnline'
|
||||
pkgNameSuffix = 'es.tumangaonline'
|
||||
extClass = '.TuMangaOnline'
|
||||
extVersionCode = 8
|
||||
extVersionCode = 9
|
||||
libVersion = '1.2'
|
||||
}
|
||||
|
||||
|
|
|
@ -22,10 +22,11 @@ class TuMangaOnline : ParsedHttpSource() {
|
|||
|
||||
override val supportsLatest = true
|
||||
|
||||
private val rateLimitInterceptor = RateLimitInterceptor(4)
|
||||
private val rateLimitInterceptor = RateLimitInterceptor(2)
|
||||
|
||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||
.addNetworkInterceptor(rateLimitInterceptor).connectTimeout(1, TimeUnit.MINUTES)
|
||||
.addNetworkInterceptor(rateLimitInterceptor)
|
||||
.connectTimeout(1, TimeUnit.MINUTES)
|
||||
.readTimeout(1, TimeUnit.MINUTES)
|
||||
.retryOnConnectionFailure(true)
|
||||
.followRedirects(true)
|
||||
|
@ -68,6 +69,17 @@ class TuMangaOnline : ParsedHttpSource() {
|
|||
thumbnail_url = it.select("style").toString().substringAfter("('").substringBeforeLast("')")
|
||||
}
|
||||
}
|
||||
|
||||
override fun latestUpdatesParse(response: Response): MangasPage {
|
||||
val document = response.asJsoup()
|
||||
val mangas = document.select(latestUpdatesSelector())
|
||||
.distinctBy { it.select("div.thumbnail-title > h4.text-truncate").text().trim() }
|
||||
.map { latestUpdatesFromElement(it) }
|
||||
val hasNextPage = latestUpdatesNextPageSelector().let { selector ->
|
||||
document.select(selector).first()
|
||||
} != null
|
||||
return MangasPage(mangas, hasNextPage)
|
||||
}
|
||||
|
||||
override fun latestUpdatesFromElement(element: Element) = SManga.create().apply {
|
||||
element.select("div.upload-file-row > a").let {
|
||||
|
|
Loading…
Reference in New Issue