diff --git a/app/src/main/java/com/simplemobiletools/gallery/Utils.kt b/app/src/main/java/com/simplemobiletools/gallery/Utils.kt index 30bb0b592..7a9905428 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/Utils.kt +++ b/app/src/main/java/com/simplemobiletools/gallery/Utils.kt @@ -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) diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java index ed8d2f51c..de44d693f 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java @@ -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); }