[Android] AudioPlaylistMode: fix tracks for TV

Duncan McNamara git at videolan.org
Mon Aug 28 12:06:11 UTC 2023


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Wed Aug 23 17:12:39 2023 +0200| [edfdaf4d97ae1b98fe24dd816284b0c364a43d0f] | committer: Nicolas Pomepuy

AudioPlaylistMode: fix tracks for TV

When playing a track on tv, there wasn't any check on playlist mode

> https://code.videolan.org/videolan/vlc-android/commit/edfdaf4d97ae1b98fe24dd816284b0c364a43d0f
---

 .../java/org/videolan/television/ui/browser/MediaBrowserTvFragment.kt  | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/application/television/src/main/java/org/videolan/television/ui/browser/MediaBrowserTvFragment.kt b/application/television/src/main/java/org/videolan/television/ui/browser/MediaBrowserTvFragment.kt
index 8e84091319..45dce5b23a 100644
--- a/application/television/src/main/java/org/videolan/television/ui/browser/MediaBrowserTvFragment.kt
+++ b/application/television/src/main/java/org/videolan/television/ui/browser/MediaBrowserTvFragment.kt
@@ -16,6 +16,7 @@ import org.videolan.television.ui.TvItemAdapter
 import org.videolan.television.ui.TvUtil
 import org.videolan.television.viewmodel.MediaBrowserViewModel
 import org.videolan.television.viewmodel.getMediaBrowserModel
+import org.videolan.tools.FORCE_PLAY_ALL_AUDIO
 import org.videolan.tools.FORCE_PLAY_ALL_VIDEO
 import org.videolan.tools.Settings
 import org.videolan.vlc.R
@@ -100,6 +101,8 @@ class MediaBrowserTvFragment : BaseBrowserTvFragment<MediaLibraryItem>() {
         lifecycleScope.launchWhenStarted {
             if ((viewModel as MediaBrowserViewModel).category == CATEGORY_VIDEOS && !Settings.getInstance(requireContext()).getBoolean(FORCE_PLAY_ALL_VIDEO, Settings.tvUI)) {
                 TvUtil.playMedia(requireActivity(), item as MediaWrapper)
+            } else if ((viewModel as MediaBrowserViewModel).category == CATEGORY_SONGS && !Settings.getInstance(requireContext()).getBoolean(FORCE_PLAY_ALL_AUDIO, Settings.tvUI)) {
+                TvUtil.playMedia(requireActivity(), item as MediaWrapper)
             } else {
                 TvUtil.openMediaFromPaged(requireActivity(), item, viewModel.provider as MedialibraryProvider<out MediaLibraryItem>)
             }



More information about the Android mailing list