mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 07:20:30 +05:30
Merge pull request #7347 from Bnyro/master
fix: add missing dearrow calls to playlist fragment and video player
This commit is contained in:
commit
6df5904cb9
@ -35,6 +35,7 @@ import com.github.libretube.helpers.ProxyHelper
|
||||
import com.github.libretube.parcelable.PlayerData
|
||||
import com.github.libretube.util.PlayingQueue
|
||||
import com.github.libretube.util.YoutubeHlsPlaylistParser
|
||||
import com.github.libretube.util.deArrow
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
@ -126,7 +127,7 @@ open class OnlinePlayerService : AbstractPlayerService() {
|
||||
|
||||
streams = withContext(Dispatchers.IO) {
|
||||
try {
|
||||
MediaServiceRepository.instance.getStreams(videoId)
|
||||
MediaServiceRepository.instance.getStreams(videoId).deArrow(videoId)
|
||||
} catch (e: IOException) {
|
||||
toastFromMainDispatcher(getString(R.string.unknown_error))
|
||||
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.PlaylistOptionsBottomSheet
|
||||
import com.github.libretube.util.PlayingQueue
|
||||
import com.github.libretube.util.deArrow
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
@ -391,7 +392,9 @@ class PlaylistFragment : DynamicLayoutManagerFragment(R.layout.fragment_playlist
|
||||
val response = try {
|
||||
withContext(Dispatchers.IO) {
|
||||
// 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) {
|
||||
context?.toastFromMainDispatcher(e.localizedMessage.orEmpty())
|
||||
|
@ -78,14 +78,14 @@ class HomeViewModel : ViewModel() {
|
||||
|
||||
runSafely(
|
||||
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) {
|
||||
runSafely(
|
||||
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