Skip to content

Commit

Permalink
refix
Browse files Browse the repository at this point in the history
  • Loading branch information
LagradOst committed Nov 2, 2021
1 parent 02ece89 commit 38e08c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ResultEpisode>()
for ((index, i) in ep.value.withIndex()) {
idIndex++

val episode = i.episode ?: (index + 1)
episodes.add(
Expand All @@ -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,
Expand All @@ -322,6 +321,7 @@ class ResultViewModel : ViewModel() {
)
)
}
idIndex++

Pair(ep.key, episodes)
}.toMap()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 38e08c9

Please sign in to comment.