From a34685176f78a6844f7a310c6a17f0e30973eb72 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 18 Dec 2016 18:25:12 +0100 Subject: [PATCH] add a file to invalids only if it doesnt exist --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 2 +- .../simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index 38946513c..5314ed82d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -51,7 +51,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va val file = File(fullPath) val size = cursor.getLongValue(MediaStore.Images.Media.SIZE) - if (size == 0L) { + if (size == 0L && !file.exists()) { invalidFiles.add(file) continue } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt index b3217a41d..f626266d4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt @@ -55,7 +55,7 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickVideo val file = File(curPath) val size = cursor.getLongValue(MediaStore.Images.Media.SIZE) - if (size == 0L) { + if (size == 0L && !file.exists()) { invalidFiles.add(file) continue }