mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20: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)
|
intent.putExtra(IntentData.channelName, channelName)
|
||||||
}
|
}
|
||||||
uri.path!!.contains("/playlist") -> {
|
uri.path!!.contains("/playlist") -> {
|
||||||
var playlistId = uri.query!!
|
val playlistId = uri.getQueryParameter("list")
|
||||||
if (playlistId.contains("&")) {
|
|
||||||
for (v in playlistId.split("&")) {
|
|
||||||
if (v.contains("list=")) {
|
|
||||||
playlistId = v.replace("list=", "")
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
playlistId = playlistId.replace("list=", "")
|
|
||||||
}
|
|
||||||
|
|
||||||
intent.putExtra(IntentData.playlistId, playlistId)
|
intent.putExtra(IntentData.playlistId, playlistId)
|
||||||
}
|
}
|
||||||
@ -81,20 +71,7 @@ class RouterActivity : BaseActivity() {
|
|||||||
intent.putExtra(IntentData.videoId, videoId)
|
intent.putExtra(IntentData.videoId, videoId)
|
||||||
}
|
}
|
||||||
uri.path!!.contains("/watch") && uri.query != null -> {
|
uri.path!!.contains("/watch") && uri.query != null -> {
|
||||||
var videoId = uri.query!!
|
val videoId = uri.getQueryParameter("v")
|
||||||
|
|
||||||
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=", "")
|
|
||||||
}
|
|
||||||
|
|
||||||
intent.putExtra(IntentData.videoId, videoId)
|
intent.putExtra(IntentData.videoId, videoId)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user