From 75ac93e493c75530fbc24631e1b648e8c90c22bb Mon Sep 17 00:00:00 2001 From: yueehaoo Date: Mon, 11 Dec 2023 21:57:55 +0800 Subject: [PATCH] Revert "Fixing Source List Displaying Empty Items" This reverts commit 8ba4879574bd586e0344e58f13f20513191bb149. --- .../ui/player/PlayerGeneratorViewModel.kt | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerGeneratorViewModel.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerGeneratorViewModel.kt index 03d97e87..3179cb9f 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerGeneratorViewModel.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/player/PlayerGeneratorViewModel.kt @@ -184,20 +184,16 @@ class PlayerGeneratorViewModel : ViewModel() { _loadingLinks.postValue(Resource.Loading()) val loadingState = safeApiCall { generator?.generateLinks(type = type, clearCache = clearCache, callback = { - if (it.first?.url?.isNotEmpty() == true) { - currentLinks.add(it) - // Clone to prevent ConcurrentModificationException - normalSafeApiCall { - // Extra normalSafeApiCall since .toSet() iterates. - _currentLinks.postValue(currentLinks.toSet()) - } + currentLinks.add(it) + // Clone to prevent ConcurrentModificationException + normalSafeApiCall { + // Extra normalSafeApiCall since .toSet() iterates. + _currentLinks.postValue(currentLinks.toSet()) } }, subtitleCallback = { - if (it.url.isNotEmpty()) { - currentSubs.add(it) - normalSafeApiCall { - _currentSubs.postValue(currentSubs.toSet()) - } + currentSubs.add(it) + normalSafeApiCall { + _currentSubs.postValue(currentSubs.toSet()) } }) }