mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-07-25 21:32:58 +00:00
Use Kotlin's .toUri() instead of Uri.parse()
This commit is contained in:
parent
834c93f22a
commit
a4d457b2b2
@ -104,7 +104,7 @@ class MediaBrowserImpl(
|
||||
|
||||
private fun onLoadChildren(parentId: String): Single<List<MediaBrowserCompat.MediaItem>> {
|
||||
try {
|
||||
val parentIdUri = Uri.parse(parentId)
|
||||
val parentIdUri = parentId.toUri()
|
||||
val path = ArrayList(parentIdUri.pathSegments)
|
||||
|
||||
if (path.isEmpty()) {
|
||||
|
@ -6,6 +6,7 @@ import android.os.Bundle
|
||||
import android.os.ResultReceiver
|
||||
import android.support.v4.media.session.PlaybackStateCompat
|
||||
import android.util.Log
|
||||
import androidx.core.net.toUri
|
||||
import com.google.android.exoplayer2.Player
|
||||
import com.google.android.exoplayer2.ext.mediasession.MediaSessionConnector.PlaybackPreparer
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
@ -137,7 +138,7 @@ class MediaBrowserPlaybackPreparer(
|
||||
|
||||
private fun extractPlayQueueFromMediaId(mediaId: String): Single<PlayQueue> {
|
||||
try {
|
||||
val mediaIdUri = Uri.parse(mediaId)
|
||||
val mediaIdUri = mediaId.toUri()
|
||||
val path = ArrayList(mediaIdUri.pathSegments)
|
||||
if (path.isEmpty()) {
|
||||
throw parseError(mediaId)
|
||||
|
Loading…
x
Reference in New Issue
Block a user