aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-09-08 20:24:02 -0700
committerScott Jackson <daneren2005@gmail.com>2014-09-08 20:24:02 -0700
commita4c180815f3c1170efc31af5232b83099ae0d9af (patch)
tree6ce49009140dfae9d8591644462bb418f17caed4 /src/github/daneren2005
parent11489be460922dcbb94af5b6f91baaa47759ae52 (diff)
downloaddsub-a4c180815f3c1170efc31af5232b83099ae0d9af.tar.gz
dsub-a4c180815f3c1170efc31af5232b83099ae0d9af.tar.bz2
dsub-a4c180815f3c1170efc31af5232b83099ae0d9af.zip
Fix deleting videos from MediaStore via File
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/service/MediaStoreService.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/service/MediaStoreService.java b/src/github/daneren2005/dsub/service/MediaStoreService.java
index b641a54f..0aa3269f 100644
--- a/src/github/daneren2005/dsub/service/MediaStoreService.java
+++ b/src/github/daneren2005/dsub/service/MediaStoreService.java
@@ -135,7 +135,14 @@ public class MediaStoreService {
public void deleteFromMediaStore(File file) {
ContentResolver contentResolver = context.getContentResolver();
- int n = contentResolver.delete(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
+ Uri uri;
+ if(FileUtil.isVideoFile(file)) {
+ uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
+ } else {
+ uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
+ }
+
+ int n = contentResolver.delete(uri,
MediaStore.MediaColumns.DATA + "=?",
new String[]{file.getAbsolutePath()});
if (n > 0) {