mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
try scanning Screenshots and Downloads folders thoroughly
This commit is contained in:
parent
be3c8a7b89
commit
5468baf513
1 changed files with 13 additions and 1 deletions
|
@ -3,6 +3,7 @@ package com.simplemobiletools.gallery.helpers
|
|||
import android.content.Context
|
||||
import android.database.Cursor
|
||||
import android.net.Uri
|
||||
import android.os.Environment
|
||||
import android.provider.MediaStore
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.*
|
||||
|
@ -200,7 +201,18 @@ class MediaFetcher(val context: Context) {
|
|||
}
|
||||
}
|
||||
|
||||
config.includedFolders.filter { it.isNotEmpty() && (curPath.isEmpty() || it == curPath) }.forEach {
|
||||
val downloadsFolder = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).toString()
|
||||
val screenshotsFolder = "${Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)}/Screenshots"
|
||||
val foldersToScan = config.includedFolders
|
||||
if (File(downloadsFolder).exists()) {
|
||||
foldersToScan.add(downloadsFolder)
|
||||
}
|
||||
|
||||
if (File(screenshotsFolder).exists()) {
|
||||
foldersToScan.add(screenshotsFolder)
|
||||
}
|
||||
|
||||
foldersToScan.filter { it.isNotEmpty() && (curPath.isEmpty() || it == curPath) }.forEach {
|
||||
if (it.startsWith(OTG_PATH)) {
|
||||
getMediaOnOTG(it, curMedia, isPickImage, isPickVideo, filterMedia, allowRecursion)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue