mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
fix: add missing dearrow calls to playlist fragment and video player
This commit is contained in:
parent
c7a587f509
commit
66c690a6af
@ -35,6 +35,7 @@ import com.github.libretube.helpers.ProxyHelper
|
|||||||
import com.github.libretube.parcelable.PlayerData
|
import com.github.libretube.parcelable.PlayerData
|
||||||
import com.github.libretube.util.PlayingQueue
|
import com.github.libretube.util.PlayingQueue
|
||||||
import com.github.libretube.util.YoutubeHlsPlaylistParser
|
import com.github.libretube.util.YoutubeHlsPlaylistParser
|
||||||
|
import com.github.libretube.util.deArrow
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
@ -126,7 +127,7 @@ open class OnlinePlayerService : AbstractPlayerService() {
|
|||||||
|
|
||||||
streams = withContext(Dispatchers.IO) {
|
streams = withContext(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
MediaServiceRepository.instance.getStreams(videoId)
|
MediaServiceRepository.instance.getStreams(videoId).deArrow(videoId)
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
toastFromMainDispatcher(getString(R.string.unknown_error))
|
toastFromMainDispatcher(getString(R.string.unknown_error))
|
||||||
return@withContext null
|
return@withContext null
|
||||||
|
@ -46,6 +46,7 @@ import com.github.libretube.ui.models.CommonPlayerViewModel
|
|||||||
import com.github.libretube.ui.sheets.BaseBottomSheet
|
import com.github.libretube.ui.sheets.BaseBottomSheet
|
||||||
import com.github.libretube.ui.sheets.PlaylistOptionsBottomSheet
|
import com.github.libretube.ui.sheets.PlaylistOptionsBottomSheet
|
||||||
import com.github.libretube.util.PlayingQueue
|
import com.github.libretube.util.PlayingQueue
|
||||||
|
import com.github.libretube.util.deArrow
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
@ -391,7 +392,9 @@ class PlaylistFragment : DynamicLayoutManagerFragment(R.layout.fragment_playlist
|
|||||||
val response = try {
|
val response = try {
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
// load locally stored playlists with the auth api
|
// load locally stored playlists with the auth api
|
||||||
MediaServiceRepository.instance.getPlaylistNextPage(playlistId, nextPage!!)
|
MediaServiceRepository.instance.getPlaylistNextPage(playlistId, nextPage!!).apply {
|
||||||
|
relatedStreams = relatedStreams.deArrow()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
context?.toastFromMainDispatcher(e.localizedMessage.orEmpty())
|
context?.toastFromMainDispatcher(e.localizedMessage.orEmpty())
|
||||||
|
@ -78,14 +78,14 @@ class HomeViewModel : ViewModel() {
|
|||||||
|
|
||||||
runSafely(
|
runSafely(
|
||||||
onSuccess = { videos -> trending.updateIfChanged(videos) },
|
onSuccess = { videos -> trending.updateIfChanged(videos) },
|
||||||
ioBlock = { MediaServiceRepository.instance.getTrending(region).deArrow().take(10) }
|
ioBlock = { MediaServiceRepository.instance.getTrending(region).take(10).deArrow() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun loadFeed(subscriptionsViewModel: SubscriptionsViewModel) {
|
private suspend fun loadFeed(subscriptionsViewModel: SubscriptionsViewModel) {
|
||||||
runSafely(
|
runSafely(
|
||||||
onSuccess = { videos -> feed.updateIfChanged(videos) },
|
onSuccess = { videos -> feed.updateIfChanged(videos) },
|
||||||
ioBlock = { tryLoadFeed(subscriptionsViewModel).deArrow().take(20) }
|
ioBlock = { tryLoadFeed(subscriptionsViewModel).take(20).deArrow() }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user