mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
proper uri handling
This commit is contained in:
parent
0dc17de044
commit
c3ad60f19c
@ -55,17 +55,7 @@ class RouterActivity : BaseActivity() {
|
||||
intent.putExtra(IntentData.channelName, channelName)
|
||||
}
|
||||
uri.path!!.contains("/playlist") -> {
|
||||
var playlistId = uri.query!!
|
||||
if (playlistId.contains("&")) {
|
||||
for (v in playlistId.split("&")) {
|
||||
if (v.contains("list=")) {
|
||||
playlistId = v.replace("list=", "")
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
playlistId = playlistId.replace("list=", "")
|
||||
}
|
||||
val playlistId = uri.getQueryParameter("list")
|
||||
|
||||
intent.putExtra(IntentData.playlistId, playlistId)
|
||||
}
|
||||
@ -81,20 +71,7 @@ class RouterActivity : BaseActivity() {
|
||||
intent.putExtra(IntentData.videoId, videoId)
|
||||
}
|
||||
uri.path!!.contains("/watch") && uri.query != null -> {
|
||||
var videoId = uri.query!!
|
||||
|
||||
if (videoId.contains("&")) {
|
||||
val watches = videoId.split("&")
|
||||
for (v in watches) {
|
||||
if (v.contains("v=")) {
|
||||
videoId = v.replace("v=", "")
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
videoId = videoId
|
||||
.replace("v=", "")
|
||||
}
|
||||
val videoId = uri.getQueryParameter("v")
|
||||
|
||||
intent.putExtra(IntentData.videoId, videoId)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user