This commit is contained in:
LagradOst 2021-11-02 16:27:47 +01:00
parent 02ece8922d
commit 38e08c90d6
2 changed files with 4 additions and 4 deletions

View file

@ -297,11 +297,10 @@ class ResultViewModel : ViewModel() {
_dubSubSelections.postValue(d.episodes.keys) _dubSubSelections.postValue(d.episodes.keys)
val fillerEpisodes = if (showFillers) safeApiCall { getFillerEpisodes(d.name) } else null val fillerEpisodes = if (showFillers) safeApiCall { getFillerEpisodes(d.name) } else null
var idIndex = mainId var idIndex = 0
val res = d.episodes.map { ep -> val res = d.episodes.map { ep ->
val episodes = ArrayList<ResultEpisode>() val episodes = ArrayList<ResultEpisode>()
for ((index, i) in ep.value.withIndex()) { for ((index, i) in ep.value.withIndex()) {
idIndex++
val episode = i.episode ?: (index + 1) val episode = i.episode ?: (index + 1)
episodes.add( episodes.add(
@ -312,7 +311,7 @@ class ResultViewModel : ViewModel() {
null, // TODO FIX SEASON null, // TODO FIX SEASON
i.url, i.url,
apiName, apiName,
idIndex, mainId + index + 1 + idIndex * 100000,
index, index,
i.rating, i.rating,
i.description, i.description,
@ -322,6 +321,7 @@ class ResultViewModel : ViewModel() {
) )
) )
} }
idIndex++
Pair(ep.key, episodes) Pair(ep.key, episodes)
}.toMap() }.toMap()

View file

@ -346,7 +346,7 @@ object VideoDownloadManager {
val pending: PendingIntent = PendingIntent.getService( 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 // 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, actionResultIntent,
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
) )