diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt index 49743ba99..c4049327e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Context.kt @@ -318,7 +318,7 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly: fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, callback: (ArrayList) -> Unit) { Thread { val mediumDao = galleryDB.MediumDao() - val foldersToScan = if (path == "/") MediaFetcher(this).getFoldersToScan() else arrayListOf(path) + val foldersToScan = if (path.isEmpty()) MediaFetcher(this).getFoldersToScan() else arrayListOf(path) var media = ArrayList() if (path == FAVORITES) { media.addAll(mediumDao.getFavorites())