diff --git a/src/en/kouhaiwork/build.gradle b/src/en/kouhaiwork/build.gradle index 9d1f52a43..2c8230156 100644 --- a/src/en/kouhaiwork/build.gradle +++ b/src/en/kouhaiwork/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Kouhai Work' pkgNameSuffix = 'en.kouhaiwork' extClass = '.KouhaiWork' - extVersionCode = 7 + extVersionCode = 8 } apply from: "$rootDir/common.gradle" diff --git a/src/en/kouhaiwork/src/eu/kanade/tachiyomi/extension/en/kouhaiwork/KouhaiWork.kt b/src/en/kouhaiwork/src/eu/kanade/tachiyomi/extension/en/kouhaiwork/KouhaiWork.kt index 0fee2a7cc..0587fae01 100644 --- a/src/en/kouhaiwork/src/eu/kanade/tachiyomi/extension/en/kouhaiwork/KouhaiWork.kt +++ b/src/en/kouhaiwork/src/eu/kanade/tachiyomi/extension/en/kouhaiwork/KouhaiWork.kt @@ -81,28 +81,25 @@ class KouhaiWork : HttpSource() { }!! } - // Request the actual manga URL for the webview override fun mangaDetailsRequest(manga: SManga) = - GET("$baseUrl/series/${manga.url}", headers) + GET("$API_URL/manga/get/${manga.url}", headers) - override fun fetchMangaDetails(manga: SManga) = - client.newCall(chapterListRequest(manga)).asObservableSuccess().map { - val series = it.decode() - manga.description = series.toString() - manga.author = series.authors?.joinToString() - manga.artist = series.artists?.joinToString() - manga.genre = series.tags.joinToString() - manga.status = when (series.status) { + override fun mangaDetailsParse(response: Response) = + SManga.create().apply { + val series = response.decode() + description = series.toString() + author = series.authors?.joinToString() + artist = series.artists?.joinToString() + genre = series.tags.joinToString() + status = when (series.status) { "ongoing" -> SManga.ONGOING "finished" -> SManga.COMPLETED else -> SManga.UNKNOWN } - manga.initialized = true - return@map manga - }!! + initialized = true + } - override fun chapterListRequest(manga: SManga) = - GET("$API_URL/manga/get/${manga.url}", headers) + override fun chapterListRequest(manga: SManga) = mangaDetailsRequest(manga) override fun chapterListParse(response: Response) = response.decode().chapters.map { @@ -122,6 +119,10 @@ class KouhaiWork : HttpSource() { response.decode("chapter") .mapIndexed { idx, img -> Page(idx, "", img.toString()) } + override fun getMangaUrl(manga: SManga) = "$baseUrl/series/${manga.url}" + + override fun getChapterUrl(chapter: SChapter) = "$baseUrl/read/${chapter.url}" + override fun getFilterList() = FilterList( GenresFilter(), ThemesFilter(), @@ -129,9 +130,6 @@ class KouhaiWork : HttpSource() { StatusFilter(), ) - override fun mangaDetailsParse(response: Response) = - throw UnsupportedOperationException("Not used") - override fun imageUrlParse(response: Response) = throw UnsupportedOperationException("Not used")