[Android] Properly detect Playlist type to load

Geoffrey Métais git at videolan.org
Mon May 4 13:55:48 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon May  4 13:32:49 2015 +0200| [ed263b0c5ca90f0ab1bcd43b7e46a946bb0a2bb4] | committer: Geoffrey Métais

Properly detect Playlist type to load

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=ed263b0c5ca90f0ab1bcd43b7e46a946bb0a2bb4
---

 .../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java       |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index 29d798b..ccff4f1 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -368,7 +368,7 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements SwipeR
 
     private void loadPlaylist(int position) {
         ArrayList<MediaWrapper> mediaList = mPlaylistAdapter.getItem(position).mMediaList;
-        if (mediaList.size() == 1) {
+        if (mediaList.size() == 1 && mediaList.get(0).getType() == MediaWrapper.TYPE_PLAYLIST) {
             String mediaLocation = mediaList.get(0).getLocation();
             mAudioController.load(mediaLocation);
         } else {
@@ -493,7 +493,7 @@ public class AudioBrowserFragment extends MediaBrowserFragment implements SwipeR
                     break;
                 case MODE_PLAYLIST: //For file playlist, we browse tracks with mediabrowser, and add them in callbacks onMediaAdded and onBrowseEnd
                     medias = mPlaylistAdapter.getLocations(groupPosition);
-                    if (medias.size() <2) {
+                    if (medias.size() == 1 && mPlaylistAdapter.getMedia(groupPosition).get(0).getType() == MediaWrapper.TYPE_PLAYLIST) {
                         if (mMediaBrowser == null)
                             mMediaBrowser = new MediaBrowser(VLCInstance.get(), this);
                         mMediaBrowser.browse(mPlaylistAdapter.getMedia(groupPosition).get(0).getLocation());



More information about the Android mailing list