From 53519381d709876f2d7ebf73dc4cd79a63b92d16 Mon Sep 17 00:00:00 2001 From: Blatzar <46196380+Blatzar@users.noreply.github.com> Date: Thu, 22 Dec 2022 13:11:37 +0100 Subject: [PATCH] Set default start season to 1 --- .../com/lagradost/cloudstream3/ui/result/ResultViewModel2.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel2.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel2.kt index f5aae7fc..994d4759 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel2.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel2.kt @@ -1926,7 +1926,7 @@ class ResultViewModel2 : ViewModel() { // this takes the indexer most preferable by the user given the current sorting val min = ranges.keys.minByOrNull { index -> kotlin.math.abs( - index.season - (preferStartSeason ?: 0) + index.season - (preferStartSeason ?: 1) ) + if (index.dubStatus == preferDubStatus) 0 else 100000 } @@ -2139,7 +2139,7 @@ class ResultViewModel2 : ViewModel() { preferDubStatus = getDub(mainId) ?: preferDubStatus preferStartEpisode = getResultEpisode(mainId) - preferStartSeason = getResultSeason(mainId) + preferStartSeason = getResultSeason(mainId) ?: 1 setKey( DOWNLOAD_HEADER_CACHE,