mirror of
				https://github.com/SimpleMobileTools/Simple-Gallery.git
				synced 2025-06-05 21:59:19 +02:00 
			
		
		
		
	try scanning Screenshots and Downloads folders thoroughly
This commit is contained in:
		| @@ -3,6 +3,7 @@ package com.simplemobiletools.gallery.helpers | |||||||
| import android.content.Context | import android.content.Context | ||||||
| import android.database.Cursor | import android.database.Cursor | ||||||
| import android.net.Uri | import android.net.Uri | ||||||
|  | import android.os.Environment | ||||||
| import android.provider.MediaStore | import android.provider.MediaStore | ||||||
| import com.simplemobiletools.commons.extensions.* | import com.simplemobiletools.commons.extensions.* | ||||||
| import com.simplemobiletools.commons.helpers.* | 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)) { |             if (it.startsWith(OTG_PATH)) { | ||||||
|                 getMediaOnOTG(it, curMedia, isPickImage, isPickVideo, filterMedia, allowRecursion) |                 getMediaOnOTG(it, curMedia, isPickImage, isPickVideo, filterMedia, allowRecursion) | ||||||
|             } else { |             } else { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user