[Android] Create media on the fly if not exists in DB (in append)

Sébastien Toque git at videolan.org
Mon Jul 23 19:53:21 CEST 2012


android | branch: master | Sébastien Toque <xilasz at gmail.com> | Mon Jul 23 16:49:45 2012 +0200| [ae9bc06d9808166018d68e02359dfb4c6a452ce2] | committer: Sébastien Toque

Create media on the fly if not exists in DB (in append)

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

 vlc-android/src/org/videolan/vlc/AudioService.java |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/AudioService.java b/vlc-android/src/org/videolan/vlc/AudioService.java
index 9626796..ce48b8e 100644
--- a/vlc-android/src/org/videolan/vlc/AudioService.java
+++ b/vlc-android/src/org/videolan/vlc/AudioService.java
@@ -700,6 +700,10 @@ public class AudioService extends Service {
             for (int i = 0; i < mediaPathList.size(); i++) {
                 String path = mediaPathList.get(i);
                 Media media = db.getMedia(AudioService.this, path);
+                if(media == null) {
+                    Log.v(TAG, "Creating on-the-fly Media object for " + path);
+                    media = new Media(path, false);
+                }
                 mMediaList.add(media);
             }
         }



More information about the Android mailing list