From fd0c5f4b429c7ca9e9f40fda24a50c8a49536c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20S=C3=A1nchez?= Date: Mon, 12 Dec 2022 23:29:25 -0300 Subject: [PATCH] Update MundoDonghuaProvider.kt --- .../kotlin/com/lagradost/MundoDonghuaProvider.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt index 6e4e819..a0d0635 100644 --- a/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt +++ b/MundoDonghuaProvider/src/main/kotlin/com/lagradost/MundoDonghuaProvider.kt @@ -103,11 +103,17 @@ class MundoDonghuaProvider : MainAPI() { "Finalizada" -> ShowStatus.Completed else -> null } + var counter = 0 val specialEpisodes = docSpecial.select(".col-xs-4").mapNotNull { - val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" - val link = it.selectFirst("a")?.attr("href") ?: "" - if (name.contains(title, true)) { - Episode(fixUrl(link), name) + counter++ + if (counter < 7) { + val name = it.selectFirst("h5")?.text()?.replace("Episodio","-") ?: "" + val link = it.selectFirst("a")?.attr("href") ?: "" + if (name.contains(title, true)) { + Episode(fixUrl(link), name) + } else { + null + } } else { null }