From 8e29f84f0b2c029db9556d400a9254b264a9deb5 Mon Sep 17 00:00:00 2001 From: Arjix <53124886+ArjixWasTaken@users.noreply.github.com> Date: Fri, 20 Aug 2021 22:07:48 +0300 Subject: [PATCH] uhh --- .../cloudstream3/movieproviders/TrailersToProvider.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TrailersToProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TrailersToProvider.kt index 81d5147f..ded13314 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TrailersToProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TrailersToProvider.kt @@ -229,13 +229,13 @@ class TrailersToProvider : MainAPI() { val titleHeader = main.selectFirst("a") val titleName = titleHeader.text() val href = fixUrl(titleHeader.attr("href")) - val gValues = Regex(""".*?Season ([0-9]+)\s-\s(?:Episode )?([0-9]+)?(?:: )?(.*)""").find(titleName)!!.destructured - val season = gValues.component1().toIntOrNull() - var episode = gValues.component2().toIntOrNull() + val gValues = Regex(""".*?Season ([0-9]+)\s-\s(?:Episode )?([0-9]+)?(?:: )?(.*)""").find(titleName)?.destructured + val season = gValues?.component1()?.toIntOrNull() + var episode = gValues?.component2()?.toIntOrNull() if (episode == null) { episode = index + 1 } - val epName = if (!gValues.component3().isEmpty()) gValues.component3() else "Episode ${gValues.component2()}" + val epName = if (gValues?.component3()?.isNotEmpty() == true) gValues.component3() else "Episode ${gValues?.component2()}" val infoHeaders = main.select("span.small-text") val date = infoHeaders?.get(0)?.text() val ratingText = infoHeaders?.get(1)?.text()?.replace("/ 10", "")