League of Legends: fix series list (#15833)
* League of Legends: update for extensions-lib 1.4 * League of Legends: fix series list
This commit is contained in:
parent
9f68bdf964
commit
a4b8c02799
|
@ -6,7 +6,7 @@ ext {
|
|||
extName = 'League of Legends'
|
||||
pkgNameSuffix = 'all.leagueoflegends'
|
||||
extClass = '.LOLFactory'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -24,22 +24,22 @@ data class LOLData(
|
|||
|
||||
@Serializable
|
||||
data class LOLComic(
|
||||
val title: String,
|
||||
val title: String? = null,
|
||||
val subtitle: String? = null,
|
||||
val index: Float? = null,
|
||||
private val url: String,
|
||||
val description: String,
|
||||
val background: LOLImage,
|
||||
private val url: String? = null,
|
||||
val description: String? = null,
|
||||
val background: LOLImage? = null,
|
||||
@SerialName("featured-champions")
|
||||
val champions: List<LOLChampion>? = null,
|
||||
) {
|
||||
override fun toString() = url.substringAfter("/comic/")
|
||||
override fun toString() = url?.substringAfter("/comic/") ?: error("Empty URL")
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class LOLIssues(
|
||||
private val issues: List<LOLComic>,
|
||||
) : Iterable<LOLComic> by issues
|
||||
) : Iterable<LOLComic> by issues.reversed()
|
||||
|
||||
@Serializable
|
||||
data class LOLPages(
|
||||
|
|
|
@ -36,10 +36,6 @@ class LOLUniverse(
|
|||
override fun popularMangaRequest(page: Int) =
|
||||
GET("$MEEPS_URL/$siteLang/comics/index.json", headers)
|
||||
|
||||
// Request the actual manga URL for the webview
|
||||
override fun mangaDetailsRequest(manga: SManga) =
|
||||
GET("$UNIVERSE_URL/$siteLang/comic/${manga.url}")
|
||||
|
||||
override fun chapterListRequest(manga: SManga) =
|
||||
GET("$MEEPS_URL/$siteLang/comics/${manga.url}/index.json", headers)
|
||||
|
||||
|
@ -47,11 +43,11 @@ class LOLUniverse(
|
|||
GET("$COMICS_URL/$siteLang/${chapter.url}/index.json", headers)
|
||||
|
||||
override fun popularMangaParse(response: Response) =
|
||||
response.decode<LOLHub>().map {
|
||||
response.decode<LOLHub>().mapNotNull {
|
||||
SManga.create().apply {
|
||||
title = it.title
|
||||
title = it.title ?: return@mapNotNull null
|
||||
url = it.toString()
|
||||
description = it.description.clean()
|
||||
description = it.description!!.clean()
|
||||
thumbnail_url = it.background.toString()
|
||||
genre = it.subtitle ?: it.champions?.joinToString()
|
||||
}
|
||||
|
@ -60,7 +56,7 @@ class LOLUniverse(
|
|||
override fun chapterListParse(response: Response) =
|
||||
response.decode<LOLIssues>().map {
|
||||
SChapter.create().apply {
|
||||
name = it.title
|
||||
name = it.title!!
|
||||
url = it.toString()
|
||||
chapter_number = it.index ?: -1f
|
||||
fetchPageList()
|
||||
|
@ -88,12 +84,21 @@ class LOLUniverse(
|
|||
override fun fetchPageList(chapter: SChapter) =
|
||||
Observable.just(pageCache[chapter.url].orEmpty())!!
|
||||
|
||||
override fun getMangaUrl(manga: SManga) =
|
||||
"$UNIVERSE_URL/$siteLang/comic/${manga.url}"
|
||||
|
||||
override fun getChapterUrl(chapter: SChapter) =
|
||||
"$UNIVERSE_URL/$siteLang/comic/${chapter.url}"
|
||||
|
||||
override fun latestUpdatesRequest(page: Int) =
|
||||
throw UnsupportedOperationException("Not used")
|
||||
|
||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) =
|
||||
throw UnsupportedOperationException("Not used")
|
||||
|
||||
override fun mangaDetailsRequest(manga: SManga) =
|
||||
throw UnsupportedOperationException("Not used")
|
||||
|
||||
override fun latestUpdatesParse(response: Response) =
|
||||
throw UnsupportedOperationException("Not used")
|
||||
|
||||
|
|
Loading…
Reference in New Issue