Commit 90f0eb3c authored by Geoffrey Métais's avatar Geoffrey Métais

Check extension on filename instead of media title

parent 9b15d214
......@@ -161,22 +161,17 @@ public class MediaWrapper implements Parcelable {
if (mType != TYPE_ALL)
return;
String fileExt = null;
int dotIndex = mTitle != null ? mTitle.lastIndexOf(".") : -1;
if (dotIndex != -1) {
fileExt = mTitle.substring(dotIndex).toLowerCase(Locale.ENGLISH);
} else {
final int index = mUri.toString().indexOf('?');
String location;
if (index == -1)
location = mUri.toString();
else
location = mUri.toString().substring(0, index);
dotIndex = location.lastIndexOf(".");
if (dotIndex != -1)
fileExt = location.substring(dotIndex).toLowerCase(Locale.ENGLISH);
}
String fileExt = null, filename = mUri.getLastPathSegment();
if (filename == null)
return;
final int index = filename.indexOf('?');
if (index != -1)
filename = filename.substring(0, index);
index = filename.lastIndexOf(".");
if (index != -1)
fileExt = filename.substring(index).toLowerCase(Locale.ENGLISH);
if (!TextUtils.isEmpty(fileExt)) {
if (Extensions.VIDEO.contains(fileExt)) {
......
Markdown is supported
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