Skip to content

Commit

Permalink
fix(fr/animesama): Latest page (#3323)
Browse files Browse the repository at this point in the history
  • Loading branch information
hollowshiroyuki authored Jun 10, 2024
1 parent a49a60b commit 8be06e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/fr/animesama/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Anime-Sama'
extClass = '.AnimeSama'
extVersionCode = 9
extVersionCode = 10
}

apply from: "$rootDir/common.gradle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import eu.kanade.tachiyomi.util.asJsoup
import eu.kanade.tachiyomi.util.parallelCatchingFlatMap
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.Request
import okhttp3.Response
import uy.kohesive.injekt.Injekt
Expand Down Expand Up @@ -64,9 +65,13 @@ class AnimeSama : ConfigurableAnimeSource, AnimeHttpSource() {
// =============================== Latest ===============================
override fun latestUpdatesParse(response: Response): AnimesPage {
val animes = response.asJsoup()
val seasons = animes.select("h2:contains(derniers ajouts) + .scrollBarStyled > div").flatMap {
val animeUrl = it.getElementsByTag("a").attr("href")
fetchAnimeSeasons(animeUrl)
val seasons = animes.select("#containerAjoutsAnimes > div").flatMap {
val animeUrl = it.getElementsByTag("a").attr("href").toHttpUrl()
val url = animeUrl.newBuilder()
.removePathSegment(animeUrl.pathSize - 2)
.removePathSegment(animeUrl.pathSize - 3)
.build()
fetchAnimeSeasons(url.toString())
}
return AnimesPage(seasons, false)
}
Expand Down

0 comments on commit 8be06e4

Please sign in to comment.