mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
commit
1f95760271
@ -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)
|
||||
}
|
||||
|
@ -101,7 +101,6 @@ import com.google.android.exoplayer2.upstream.DefaultHttpDataSource
|
||||
import com.google.android.exoplayer2.util.RepeatModeUtil
|
||||
import com.google.android.exoplayer2.video.VideoSize
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import kotlin.math.abs
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
@ -109,6 +108,7 @@ import org.chromium.net.CronetEngine
|
||||
import retrofit2.HttpException
|
||||
import java.io.IOException
|
||||
import java.util.concurrent.Executors
|
||||
import kotlin.math.abs
|
||||
|
||||
class PlayerFragment : BaseFragment() {
|
||||
|
||||
|
@ -46,7 +46,10 @@ class SearchFragment : BaseFragment() {
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
binding.suggestionsRecycler.layoutManager = LinearLayoutManager(requireContext())
|
||||
binding.suggestionsRecycler.layoutManager = LinearLayoutManager(requireContext()).apply {
|
||||
reverseLayout = true
|
||||
stackFromEnd = true
|
||||
}
|
||||
|
||||
// waiting for the query to change
|
||||
viewModel.searchQuery.observe(viewLifecycleOwner) {
|
||||
|
Loading…
Reference in New Issue
Block a user