mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
store fetched media in db right after getting folders
This commit is contained in:
parent
a4f62ffcd9
commit
64fe17d1b9
1 changed files with 2 additions and 0 deletions
|
@ -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 a new issue