mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Fixing Source List Displaying Empty Items
This commit is contained in:
parent
3c152e04d1
commit
8ba4879574
1 changed files with 12 additions and 8 deletions
|
@ -184,16 +184,20 @@ class PlayerGeneratorViewModel : ViewModel() {
|
||||||
_loadingLinks.postValue(Resource.Loading())
|
_loadingLinks.postValue(Resource.Loading())
|
||||||
val loadingState = safeApiCall {
|
val loadingState = safeApiCall {
|
||||||
generator?.generateLinks(type = type, clearCache = clearCache, callback = {
|
generator?.generateLinks(type = type, clearCache = clearCache, callback = {
|
||||||
currentLinks.add(it)
|
if (it.first?.url?.isNotEmpty() == true) {
|
||||||
// Clone to prevent ConcurrentModificationException
|
currentLinks.add(it)
|
||||||
normalSafeApiCall {
|
// Clone to prevent ConcurrentModificationException
|
||||||
// Extra normalSafeApiCall since .toSet() iterates.
|
normalSafeApiCall {
|
||||||
_currentLinks.postValue(currentLinks.toSet())
|
// Extra normalSafeApiCall since .toSet() iterates.
|
||||||
|
_currentLinks.postValue(currentLinks.toSet())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, subtitleCallback = {
|
}, subtitleCallback = {
|
||||||
currentSubs.add(it)
|
if (it.url.isNotEmpty()) {
|
||||||
normalSafeApiCall {
|
currentSubs.add(it)
|
||||||
_currentSubs.postValue(currentSubs.toSet())
|
normalSafeApiCall {
|
||||||
|
_currentSubs.postValue(currentSubs.toSet())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue