Fix AnimePahe episode sorting and numbering logic (#881)
* Fixed the episode number problem for animepahe * Changed hianime domain to hianime.bz * Bump AnimePahe extVersionCode to 30 for improved episode sorting and numbering * Update HiAnime.kt --------- Co-authored-by: GraveEaterMadison <GraveEaterMadison@users.noreply.github.com>
This commit is contained in:
parent
07b02f4489
commit
4df27e2211
2 changed files with 11 additions and 3 deletions
|
@ -1,11 +1,11 @@
|
|||
ext {
|
||||
extName = 'AnimePahe'
|
||||
extClass = '.AnimePahe'
|
||||
extVersionCode = 29
|
||||
extVersionCode = 30
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
||||
dependencies {
|
||||
implementation(libs.jsunpacker)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,7 +153,15 @@ class AnimePahe : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||
override fun episodeListParse(response: Response): List<SEpisode> {
|
||||
val url = response.request.url.toString()
|
||||
val session = url.substringAfter("&id=").substringBefore("&")
|
||||
return recursivePages(response, session)
|
||||
val episodeList = recursivePages(response, session)
|
||||
|
||||
return episodeList
|
||||
.sortedBy { it.date_upload } // Optional, makes sure it's in correct order
|
||||
.mapIndexed { index, episode ->
|
||||
episode.episode_number = (index + 1).toFloat()
|
||||
episode.name = "Episode ${index + 1}"
|
||||
episode
|
||||
}
|
||||
}
|
||||
|
||||
private fun parseEpisodePage(episodes: List<EpisodeDto>, animeSession: String): MutableList<SEpisode> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue