diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index 64b8d9756..cb2436672 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -10,6 +10,7 @@ import com.simplemobiletools.commons.helpers.sumByLong import com.simplemobiletools.gallery.R import com.simplemobiletools.gallery.extensions.checkAppendingHidden import com.simplemobiletools.gallery.extensions.config +import com.simplemobiletools.gallery.extensions.galleryDB import com.simplemobiletools.gallery.extensions.getDirMediaTypes import com.simplemobiletools.gallery.helpers.MediaFetcher import com.simplemobiletools.gallery.models.Directory @@ -45,6 +46,7 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va File(firstItem.path).parent } ?: continue + context.galleryDB.MediumDao().insertAll(curMedia) var thumbnail = curMedia.firstOrNull { context.getDoesFilePathExist(it.path) }?.path ?: "" if (thumbnail.startsWith(OTG_PATH)) { thumbnail = thumbnail.getOTGPublicPath(context)