Commit e33f84f4 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

Split the main constants for extensions too

parent 6057de71
......@@ -30,7 +30,8 @@ public class Media implements Comparable<Media> {
public final static String TAG = "VLC/MediaItem";
public final static HashSet<String> EXTENSIONS;
public final static HashSet<String> VIDEO_EXTENSIONS;
public final static HashSet<String> AUDIO_EXTENSIONS;
public final static String EXTENSIONS_REGEX;
public final static HashSet<String> FOLDER_BLACKLIST;
......@@ -60,11 +61,12 @@ public class Media implements Comparable<Media> {
"/media/audio/ringtones",
"/Android/data/" };
EXTENSIONS = new HashSet<String>();
VIDEO_EXTENSIONS = new HashSet<String>();
for (String item : video_extensions)
EXTENSIONS.add(item);
VIDEO_EXTENSIONS.add(item);
AUDIO_EXTENSIONS = new HashSet<String>();
for (String item : audio_extensions)
EXTENSIONS.add(item);
AUDIO_EXTENSIONS.add(item);
StringBuilder sb = new StringBuilder(115);
sb.append(".+(\\.)((?i)(");
......
......@@ -283,7 +283,8 @@ public class MediaLibrary {
int dotIndex = fileName.lastIndexOf(".");
if (dotIndex != -1) {
String fileExt = fileName.substring(dotIndex);
accepted = Media.EXTENSIONS.contains(fileExt);
accepted = Media.AUDIO_EXTENSIONS.contains(fileExt) ||
Media.VIDEO_EXTENSIONS.contains(fileExt);
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment