[Android] Add playlist append method with list

Geoffrey Métais git at videolan.org
Thu Jan 5 10:16:30 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Jan  5 09:49:22 2017 +0100| [d33b3e957881e771922f6206c41c5fe1cd1fe76a] | committer: Geoffrey Métais

Add playlist append method with list

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

 .../src/org/videolan/medialibrary/media/Playlist.java       | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/medialibrary/src/org/videolan/medialibrary/media/Playlist.java b/medialibrary/src/org/videolan/medialibrary/media/Playlist.java
index b8d5832..050d024 100644
--- a/medialibrary/src/org/videolan/medialibrary/media/Playlist.java
+++ b/medialibrary/src/org/videolan/medialibrary/media/Playlist.java
@@ -5,6 +5,8 @@ import android.os.Parcelable;
 
 import org.videolan.medialibrary.Medialibrary;
 
+import java.util.List;
+
 public class Playlist extends MediaLibraryItem {
 
     protected Playlist(long id, String name) {
@@ -28,8 +30,15 @@ public class Playlist extends MediaLibraryItem {
         return nativePlaylistAppend(ml, mId, mediaId);
     }
 
-    public boolean append(Medialibrary ml, long[] mediaId) {
-        return nativePlaylistAppendGroup(ml, mId, mediaId);
+    public boolean append(Medialibrary ml, long[] mediaIds) {
+        return nativePlaylistAppendGroup(ml, mId, mediaIds);
+    }
+
+    public boolean append(Medialibrary ml, List<Long> mediaIds) {
+        long[] ids = new long[mediaIds.size()];
+        for (int i = 0; i < ids.length; ++i)
+            ids[i] = mediaIds.get(i).longValue();
+        return nativePlaylistAppendGroup(ml, mId, ids);
     }
 
     public boolean add(Medialibrary ml, long mediaId, int position) {



More information about the Android mailing list