mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Extra safety
This commit is contained in:
parent
9f029de5af
commit
c7fc797788
1 changed files with 7 additions and 2 deletions
|
@ -165,10 +165,15 @@ class PlayerGeneratorViewModel : ViewModel() {
|
||||||
generator?.generateLinks(clearCache = clearCache, isCasting = isCasting, {
|
generator?.generateLinks(clearCache = clearCache, isCasting = isCasting, {
|
||||||
currentLinks.add(it)
|
currentLinks.add(it)
|
||||||
// Clone to prevent ConcurrentModificationException
|
// Clone to prevent ConcurrentModificationException
|
||||||
|
normalSafeApiCall {
|
||||||
|
// Extra normalSafeApiCall since .toSet() iterates.
|
||||||
_currentLinks.postValue(currentLinks.toSet())
|
_currentLinks.postValue(currentLinks.toSet())
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
currentSubs.add(it)
|
currentSubs.add(it)
|
||||||
|
normalSafeApiCall {
|
||||||
_currentSubs.postValue(currentSubs.toSet())
|
_currentSubs.postValue(currentSubs.toSet())
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue