[Android] Fix playback of all songs of an artist

Sébastien Toque git at videolan.org
Sun Apr 26 23:13:23 CEST 2015


vlc-ports/android | branch: master | Sébastien Toque <xilasz at gmail.com> | Sun Apr 26 23:12:43 2015 +0200| [6bad53ea460051355d57058e804774e2529b3c68] | committer: Sébastien Toque

Fix playback of all songs of an artist

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

 .../org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java  |    2 +-
 .../org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java   |    9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
index bdf32dd..bb07223 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioAlbumsSongsFragment.java
@@ -336,7 +336,7 @@ public class AudioAlbumsSongsFragment extends Fragment implements SwipeRefreshLa
             Intent i = new Intent(getActivity(), SecondaryActivity.class);
             i.putExtra("fragment", SecondaryActivity.ALBUM);
             i.putParcelableArrayListExtra("list", mediaList);
-            i.putExtra("filter", Util.getMediaAlbum(getActivity(), mediaList.get(0)));
+            i.putExtra("filter", mAlbumsAdapter.getTitle(p));
             startActivity(i);
             getActivity().finish();
         }
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
index c3a0cf4..0643c77 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
@@ -497,11 +497,16 @@ public class AudioBrowserListAdapter extends BaseAdapter implements SectionIndex
     public ArrayList<MediaWrapper> getMedia(int position) {
         // Return all the media of a list item list.
         ArrayList<MediaWrapper> mediaList = new ArrayList<MediaWrapper>();
-        if (!mItems.get(position).mIsSeparator)
-            mediaList.addAll(mItems.get(position).mMediaList);
+        ListItem item = mItems.get(position);
+        if (!item.mIsSeparator || !item.mMediaList.isEmpty())
+            mediaList.addAll(item.mMediaList);
         return mediaList;
     }
 
+    public String getTitle(int position) {
+        return getItem(position).mTitle;
+    }
+
     public ArrayList<String> getLocations(int position) {
         return getLocations(position, false);
     }



More information about the Android mailing list