From 27d3daf918241bb71f30f7e403ec354809299e14 Mon Sep 17 00:00:00 2001 From: Naji Astier Date: Thu, 3 Nov 2016 16:17:37 +0100 Subject: [PATCH] Add support for latest updates to Readmangatoday (#512) --- .../source/online/english/Readmangatoday.kt | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Readmangatoday.kt b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Readmangatoday.kt index 105d77d669..2d49fe564a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Readmangatoday.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/source/online/english/Readmangatoday.kt @@ -25,7 +25,7 @@ class Readmangatoday(override val id: Int) : ParsedOnlineSource() { override val lang: Language get() = EN - override val supportsLatest = false + override val supportsLatest = true override val client: OkHttpClient get() = network.cloudflareClient @@ -39,8 +39,12 @@ class Readmangatoday(override val id: Int) : ParsedOnlineSource() { override fun popularMangaInitialUrl() = "$baseUrl/hot-manga/" + override fun latestUpdatesInitialUrl() = "$baseUrl/latest-releases/" + override fun popularMangaSelector() = "div.hot-manga > div.style-list > div.box" + override fun latestUpdatesSelector() = "div.hot-manga > div.style-grid > div.box" + override fun popularMangaFromElement(element: Element, manga: Manga) { element.select("div.title > h2 > a").first().let { manga.setUrlWithoutDomain(it.attr("href")) @@ -48,8 +52,14 @@ class Readmangatoday(override val id: Int) : ParsedOnlineSource() { } } + override fun latestUpdatesFromElement(element: Element, manga: Manga) { + popularMangaFromElement(element, manga) + } + override fun popularMangaNextPageSelector() = "div.hot-manga > ul.pagination > li > a:contains(»)" + override fun latestUpdatesNextPageSelector(): String = "div.hot-manga > ul.pagination > li > a:contains(»)" + override fun searchMangaInitialUrl(query: String, filters: List) = "$baseUrl/service/advanced_search" @@ -183,21 +193,4 @@ class Readmangatoday(override val id: Int) : ParsedOnlineSource() { Filter("36", "Yaoi"), Filter("37", "Yuri") ) - - override fun latestUpdatesInitialUrl(): String { - throw UnsupportedOperationException("not implemented") - } - - override fun latestUpdatesNextPageSelector(): String { - throw UnsupportedOperationException("not implemented") - } - - override fun latestUpdatesFromElement(element: Element, manga: Manga) { - throw UnsupportedOperationException("not implemented") - } - - override fun latestUpdatesSelector(): String { - throw UnsupportedOperationException("not implemented") - } - } \ No newline at end of file