mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
fix: respect sort order when playing private playlist
This commit is contained in:
parent
4834650f81
commit
c3916cd8f2
@ -208,17 +208,19 @@ class PlaylistFragment : DynamicLayoutManagerFragment() {
|
||||
|
||||
if (playlistFeed.isEmpty()) {
|
||||
binding.nothingHere.isVisible = true
|
||||
}
|
||||
|
||||
if (playlistFeed.isEmpty()) {
|
||||
binding.playAll.isGone = true
|
||||
} else {
|
||||
binding.playAll.setOnClickListener {
|
||||
if (playlistFeed.isEmpty()) return@setOnClickListener
|
||||
|
||||
val sortedStreams = getSortedVideos()
|
||||
PlayingQueue.setStreams(sortedStreams)
|
||||
|
||||
NavigationHelper.navigateVideo(
|
||||
requireContext(),
|
||||
response.relatedStreams.first().url,
|
||||
playlistId
|
||||
sortedStreams.first().url,
|
||||
playlistId,
|
||||
keepQueue = true
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -299,8 +301,8 @@ class PlaylistFragment : DynamicLayoutManagerFragment() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun showPlaylistVideos(playlist: Playlist) {
|
||||
val videos = when {
|
||||
private fun getSortedVideos(): List<StreamItem> {
|
||||
return when {
|
||||
selectedSortOrder in listOf(0, 1) || playlistType == PlaylistType.PUBLIC -> {
|
||||
playlistFeed
|
||||
}
|
||||
@ -317,6 +319,10 @@ class PlaylistFragment : DynamicLayoutManagerFragment() {
|
||||
}.let {
|
||||
if (selectedSortOrder % 2 == 0) it else it.reversed()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showPlaylistVideos(playlist: Playlist) {
|
||||
val videos = getSortedVideos()
|
||||
|
||||
playlistAdapter = PlaylistAdapter(
|
||||
playlistFeed,
|
||||
|
Loading…
x
Reference in New Issue
Block a user