KouhaiWork: update for extensions-lib 1.4 (#15394)
This commit is contained in:
parent
d239e42d7c
commit
ee4b27f60c
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = 'Kouhai Work'
|
||||
pkgNameSuffix = 'en.kouhaiwork'
|
||||
extClass = '.KouhaiWork'
|
||||
extVersionCode = 7
|
||||
extVersionCode = 8
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -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<KouhaiSeriesDetails>()
|
||||
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<KouhaiSeriesDetails>()
|
||||
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<KouhaiSeriesDetails>().chapters.map {
|
||||
|
@ -122,6 +119,10 @@ class KouhaiWork : HttpSource() {
|
|||
response.decode<KouhaiPages>("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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue