From c26275540195745fc131be0cdbf7cc3ed2d707f6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 30 Nov 2016 22:48:37 +0100 Subject: [PATCH] scan invalid files before sorting --- .../gallery/asynctasks/GetDirectoriesAsynctask.kt | 3 +-- .../simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt | 2 +- 2 files changed, 2 insertions(+), 3 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 abd01ae59..6e3fc48ce 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -77,12 +77,11 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va } } + context.scanFiles(invalidFiles) {} val dirs = ArrayList(directories.values) filterDirectories(dirs) Directory.sorting = mConfig.directorySorting dirs.sort() - - context.scanFiles(invalidFiles) {} return dirs } 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 31585ead5..0e8ba15f5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt @@ -65,9 +65,9 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickVideo } } + context.scanFiles(invalidFiles) {} Medium.sorting = mConfig.sorting media.sort() - context.scanFiles(invalidFiles) {} return media }