fix a glitch at determining if proper date taken and last modified should be fetched

This commit is contained in:
tibbi 2020-02-12 16:29:47 +01:00
parent aeb45a1a22
commit 8a26a6c272

View file

@ -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<String>()
@ -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()) {