From 8a26a6c27271e8d55b9c89a1363596ef40d53503 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 16:29:47 +0100 Subject: [PATCH] fix a glitch at determining if proper date taken and last modified should be fetched --- .../gallery/pro/activities/MainActivity.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index b58652a18..ea356969d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -892,8 +892,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val includedFolders = config.includedFolders val tempFolderPath = config.tempFolderPath val isSortingAscending = config.directorySorting and SORT_DESCENDING == 0 - val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 - var getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 val getProperFileSize = config.directorySorting and SORT_BY_SIZE != 0 val favoritePaths = getFavoritePaths() val dirPathsToRemove = ArrayList() @@ -904,9 +902,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } - if (!getProperLastModified) { - getProperLastModified = config.getFileSorting(directory.path) and SORT_BY_DATE_MODIFIED != 0 - } + val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 || config.getFileSorting(directory.path) and SORT_BY_DATE_TAKEN != 0 + val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 || config.getFileSorting(directory.path) and SORT_BY_DATE_MODIFIED != 0 val curMedia = mLastMediaFetcher!!.getFilesFrom(directory.path, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) val newDir = if (curMedia.isEmpty()) { @@ -982,9 +979,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { return } - if (!getProperLastModified) { - getProperLastModified = config.getFileSorting(folder) and SORT_BY_DATE_MODIFIED != 0 - } + val getProperDateTaken = config.directorySorting and SORT_BY_DATE_TAKEN != 0 || config.getFileSorting(folder) and SORT_BY_DATE_TAKEN != 0 + val getProperLastModified = config.directorySorting and SORT_BY_DATE_MODIFIED != 0 || config.getFileSorting(folder) and SORT_BY_DATE_MODIFIED != 0 val newMedia = mLastMediaFetcher!!.getFilesFrom(folder, getImagesOnly, getVideosOnly, getProperDateTaken, getProperLastModified, getProperFileSize, favoritePaths, false) if (newMedia.isEmpty()) {