[Android] AudioUtil: add playlist dir

Edward Wang git at videolan.org
Wed Aug 28 20:40:35 CEST 2013


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Wed Aug 28 20:37:15 2013 +0200| [c6f3aaeb6a7f3064e789ad3639ea6d6d3a6906c1] | committer: Edward Wang

AudioUtil: add playlist dir

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

 vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
index bf3ad07..5554ade 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioUtil.java
@@ -28,6 +28,7 @@ import java.io.UnsupportedEncodingException;
 import java.math.BigInteger;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
 
 import org.videolan.vlc.BitmapCache;
 import org.videolan.vlc.Media;
@@ -57,6 +58,7 @@ public class AudioUtil {
 
     public static String CACHE_DIR = null;
     public static String COVER_DIR = null;
+    public static String PLAYLIST_DIR = null;
 
     public static void setRingtone( Media song, Activity activity){
         File newringtone = Util.URItoFile(song.getLocation());
@@ -107,10 +109,13 @@ public class AudioUtil {
         else
             CACHE_DIR = Environment.getExternalStorageDirectory().getPath() + "/Android/data/" + context.getPackageName() + "/cache";
         COVER_DIR = CACHE_DIR + "/covers/";
+        PLAYLIST_DIR = CACHE_DIR + "/playlists/";
 
-        File file = new File(COVER_DIR);
-        if (!file.exists())
-            file.mkdirs();
+        for(String path : Arrays.asList(COVER_DIR, PLAYLIST_DIR)) {
+            File file = new File(path);
+            if (!file.exists())
+                file.mkdirs();
+        }
     }
 
     private static String getCoverFromMediaStore(Context context, Media media) {



More information about the Android mailing list