File tree Expand file tree Collapse file tree
app/src/main/java/com/github/libretube Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ import com.github.libretube.helpers.ProxyHelper
3535import com.github.libretube.parcelable.PlayerData
3636import com.github.libretube.util.PlayingQueue
3737import com.github.libretube.util.YoutubeHlsPlaylistParser
38+ import com.github.libretube.util.deArrow
3839import kotlinx.coroutines.CoroutineScope
3940import kotlinx.coroutines.Dispatchers
4041import kotlinx.coroutines.launch
@@ -126,7 +127,7 @@ open class OnlinePlayerService : AbstractPlayerService() {
126127
127128 streams = withContext(Dispatchers .IO ) {
128129 try {
129- MediaServiceRepository .instance.getStreams(videoId)
130+ MediaServiceRepository .instance.getStreams(videoId).deArrow(videoId)
130131 } catch (e: IOException ) {
131132 toastFromMainDispatcher(getString(R .string.unknown_error))
132133 return @withContext null
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ import com.github.libretube.ui.models.CommonPlayerViewModel
4646import com.github.libretube.ui.sheets.BaseBottomSheet
4747import com.github.libretube.ui.sheets.PlaylistOptionsBottomSheet
4848import com.github.libretube.util.PlayingQueue
49+ import com.github.libretube.util.deArrow
4950import kotlinx.coroutines.Dispatchers
5051import kotlinx.coroutines.launch
5152import kotlinx.coroutines.runBlocking
@@ -391,7 +392,9 @@ class PlaylistFragment : DynamicLayoutManagerFragment(R.layout.fragment_playlist
391392 val response = try {
392393 withContext(Dispatchers .IO ) {
393394 // load locally stored playlists with the auth api
394- MediaServiceRepository .instance.getPlaylistNextPage(playlistId, nextPage!! )
395+ MediaServiceRepository .instance.getPlaylistNextPage(playlistId, nextPage!! ).apply {
396+ relatedStreams = relatedStreams.deArrow()
397+ }
395398 }
396399 } catch (e: Exception ) {
397400 context?.toastFromMainDispatcher(e.localizedMessage.orEmpty())
Original file line number Diff line number Diff line change @@ -78,14 +78,14 @@ class HomeViewModel : ViewModel() {
7878
7979 runSafely(
8080 onSuccess = { videos -> trending.updateIfChanged(videos) },
81- ioBlock = { MediaServiceRepository .instance.getTrending(region).deArrow().take( 10 ) }
81+ ioBlock = { MediaServiceRepository .instance.getTrending(region).take( 10 ).deArrow( ) }
8282 )
8383 }
8484
8585 private suspend fun loadFeed (subscriptionsViewModel : SubscriptionsViewModel ) {
8686 runSafely(
8787 onSuccess = { videos -> feed.updateIfChanged(videos) },
88- ioBlock = { tryLoadFeed(subscriptionsViewModel).deArrow().take( 20 ) }
88+ ioBlock = { tryLoadFeed(subscriptionsViewModel).take( 20 ).deArrow( ) }
8989 )
9090 }
9191
You can’t perform that action at this time.
0 commit comments