delete only media files at deleting a folder

This commit is contained in:
tibbi 2016-11-12 20:34:21 +01:00
parent 34d015734e
commit d2546e1a3e
2 changed files with 3 additions and 1 deletions

View file

@ -132,6 +132,8 @@ class Utils {
}
}
fun isPhotoVideo(file: File) = file.isPhotoVideo()
fun needsStupidWritePermissions(context: Context, path: String) = context.needsStupidWritePermissions(path)
fun getFileDocument(context: Context, path: String, treeUri: String) = context.getFileDocument(path, treeUri)

View file

@ -235,7 +235,7 @@ public class MainActivity extends SimpleActivity
if (dir.exists()) {
final File[] files = dir.listFiles();
for (File file : files) {
if (file.isFile()) {
if (file.isFile() && Utils.Companion.isPhotoVideo(file)) {
updatedFiles.add(file);
deleteItem(file);
}