From e4a5e00ef4859431697b6fa6333304fb6fab60f1 Mon Sep 17 00:00:00 2001 From: Jace <54625750+Jacekun@users.noreply.github.com> Date: Fri, 19 Aug 2022 09:37:11 +0800 Subject: [PATCH] Add overload method to newHomePageResponse() to allow list of HomePageList --- app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt b/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt index 6ef034ae..efeac1a1 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/MainAPI.kt @@ -344,6 +344,10 @@ fun newHomePageResponse(list: HomePageList, hasNext: Boolean? = null): HomePageR return HomePageResponse(listOf(list), hasNext = hasNext ?: list.list.isNotEmpty()) } +fun newHomePageResponse(list: List, hasNext: Boolean? = null): HomePageResponse { + return HomePageResponse(list, hasNext = hasNext ?: list.any { it.list.isNotEmpty() }) +} + /**Every provider will **not** have try catch built in, so handle exceptions when calling these functions*/ abstract class MainAPI { companion object {