From 38e08c90d61dbbbed040c28682386a8d96f31e18 Mon Sep 17 00:00:00 2001 From: LagradOst Date: Tue, 2 Nov 2021 16:27:47 +0100 Subject: [PATCH] refix --- .../com/lagradost/cloudstream3/ui/result/ResultViewModel.kt | 6 +++--- .../lagradost/cloudstream3/utils/VideoDownloadManager.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel.kt index 25e9bf37..c6a09143 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/result/ResultViewModel.kt @@ -297,11 +297,10 @@ class ResultViewModel : ViewModel() { _dubSubSelections.postValue(d.episodes.keys) val fillerEpisodes = if (showFillers) safeApiCall { getFillerEpisodes(d.name) } else null - var idIndex = mainId + var idIndex = 0 val res = d.episodes.map { ep -> val episodes = ArrayList() for ((index, i) in ep.value.withIndex()) { - idIndex++ val episode = i.episode ?: (index + 1) episodes.add( @@ -312,7 +311,7 @@ class ResultViewModel : ViewModel() { null, // TODO FIX SEASON i.url, apiName, - idIndex, + mainId + index + 1 + idIndex * 100000, index, i.rating, i.description, @@ -322,6 +321,7 @@ class ResultViewModel : ViewModel() { ) ) } + idIndex++ Pair(ep.key, episodes) }.toMap() diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt index de15e20d..4be709ac 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/VideoDownloadManager.kt @@ -346,7 +346,7 @@ object VideoDownloadManager { val pending: PendingIntent = PendingIntent.getService( // BECAUSE episodes lying near will have the same id +1, index will give the same requested as the previous episode, *100000 fixes this - context, (4337 + index * 100000 + ep.id), + context, (4337 + index * 1000000 + ep.id), actionResultIntent, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE )