From 9482f5e625c015daf457e0202f69dfb1e2905538 Mon Sep 17 00:00:00 2001 From: Blatzar <46196380+Blatzar@users.noreply.github.com> Date: Sat, 2 Jul 2022 04:25:14 +0200 Subject: [PATCH] Fixed missing episodes in aniflix --- .../cloudstream3/animeproviders/AniflixProvider.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniflixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniflixProvider.kt index 8b2e408e..4a33fa52 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniflixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/AniflixProvider.kt @@ -87,13 +87,13 @@ class AniflixProvider : MainAPI() { listOf(newEpisode("$mainUrl/api/anime/?id=$id&episode=1")) ) else - addEpisodes(DubStatus.Subbed, res.episodes.episodes?.nodes?.mapNotNull { node -> - val ep = node?.number ?: return@mapNotNull null + addEpisodes(DubStatus.Subbed, res.episodes.episodes?.nodes?.mapIndexed { index, node -> + val episodeIndex = node?.number ?: (index + 1) //"$mainUrl/_next/data/$token/watch/$id.json?episode=${node.number ?: return@mapNotNull null}&id=$id" - newEpisode("$mainUrl/api/anime?id=$id&episode=${ep}") { - episode = ep - posterUrl = node.thumbnail?.original?.url - name = node.titles?.canonical + newEpisode("$mainUrl/api/anime?id=$id&episode=${episodeIndex}") { + episode = episodeIndex + posterUrl = node?.thumbnail?.original?.url + name = node?.titles?.canonical } }) }