[Android] TvBrowser: check FORCE_PLAY_ALL before play

Duncan McNamara git at videolan.org
Thu Aug 11 13:32:34 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Mon Aug  8 15:05:57 2022 +0200| [53c6fdd47a98543d2542bc65fc680e2f59e805f6] | committer: Nicolas Pomepuy

TvBrowser: check FORCE_PLAY_ALL before play

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

 .../src/main/java/org/videolan/television/ui/TvUtil.kt       | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/application/television/src/main/java/org/videolan/television/ui/TvUtil.kt b/application/television/src/main/java/org/videolan/television/ui/TvUtil.kt
index a099df316..706956b00 100644
--- a/application/television/src/main/java/org/videolan/television/ui/TvUtil.kt
+++ b/application/television/src/main/java/org/videolan/television/ui/TvUtil.kt
@@ -46,7 +46,9 @@ import org.videolan.television.ui.audioplayer.AudioPlayerActivity
 import org.videolan.television.ui.browser.TVActivity
 import org.videolan.television.ui.browser.VerticalGridActivity
 import org.videolan.television.ui.details.MediaListActivity
+import org.videolan.tools.FORCE_PLAY_ALL
 import org.videolan.tools.HttpImageLoader
+import org.videolan.tools.Settings
 import org.videolan.tools.getposition
 import org.videolan.vlc.R
 import org.videolan.vlc.gui.DialogActivity
@@ -202,9 +204,13 @@ object TvUtil {
                 }
                 else -> {
                     model.run {
-                        val list = (dataset.getList().filterIsInstance<MediaWrapper>()).filter { it.type != MediaWrapper.TYPE_DIR }
-                        val position = list.getposition(item)
-                        MediaUtils.openList(activity, list, position)
+                        if (!Settings.getInstance(activity).getBoolean(FORCE_PLAY_ALL, false)) {
+                            MediaUtils.openMedia(activity, item)
+                        } else {
+                            val list = (dataset.getList().filterIsInstance<MediaWrapper>()).filter { it.type != MediaWrapper.TYPE_DIR }
+                            val position = list.getposition(item)
+                            MediaUtils.openList(activity, list, position)
+                        }
                     }
                 }
             }



More information about the Android mailing list