From ff9d39e1b59821c1079aa2d15ef48bc7b8638e0b Mon Sep 17 00:00:00 2001 From: Ziedelth Date: Wed, 17 Apr 2024 09:12:42 +0200 Subject: [PATCH] Fix NetflixPlatform.kt --- src/main/kotlin/fr/shikkanime/platforms/NetflixPlatform.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/fr/shikkanime/platforms/NetflixPlatform.kt b/src/main/kotlin/fr/shikkanime/platforms/NetflixPlatform.kt index 8a7e7950..8637702b 100644 --- a/src/main/kotlin/fr/shikkanime/platforms/NetflixPlatform.kt +++ b/src/main/kotlin/fr/shikkanime/platforms/NetflixPlatform.kt @@ -37,13 +37,13 @@ class NetflixPlatform : AbstractPlatform + return episodes.mapIndexedNotNull { index, episode -> val episodeTitleAndNumber = episode.selectFirst(".episode-title")?.text() val episodeTitle = episodeTitleAndNumber?.substringAfter(".") - val episodeNumber = episodeTitleAndNumber?.substringBefore(".")?.toIntOrNull() ?: -1 + val episodeNumber = episodeTitleAndNumber?.substringBefore(".")?.toIntOrNull() ?: (index + 1) val duration = episode.selectFirst(".episode-runtime")?.text() val durationInSeconds = duration?.substringBefore(" ")?.trim()?.toLongOrNull()?.times(60) ?: -1 - val image = episode.selectFirst(".episode-thumbnail-image")?.attr("src") ?: return@mapNotNull null + val image = episode.selectFirst(".episode-thumbnail-image")?.attr("src") ?: return@mapIndexedNotNull null val imageWithoutParams = image.substringBefore("?") val episodeDescription = episode.selectFirst(".epsiode-synopsis")?.text() val computedId = EncryptionManager.toSHA512("$id-${season}-$episodeNumber").substring(0..<8)