mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2024-12-24 23:44:20 +01:00
store fetched media in db right after getting folders
This commit is contained in:
parent
a4f62ffcd9
commit
64fe17d1b9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user