mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-19 06:48:00 +01:00
fetch all stored media files at "Show all folders content"
This commit is contained in:
parent
b0a26d0bd8
commit
302a7842c4
1 changed files with 25 additions and 24 deletions
|
@ -271,10 +271,10 @@ fun Context.getCachedDirectories(getVideosOnly: Boolean = false, getImagesOnly:
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, callback: (ArrayList<Medium>) -> Unit) =
|
fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImagesOnly: Boolean = false, callback: (ArrayList<Medium>) -> Unit) {
|
||||||
Thread {
|
Thread {
|
||||||
val mediumDao = galleryDB.MediumDao()
|
val mediumDao = galleryDB.MediumDao()
|
||||||
val media = mediumDao.getMediaFromPath(path) as ArrayList<Medium>
|
val media = (if (path == "/") mediumDao.getAll() else mediumDao.getMediaFromPath(path)) as ArrayList<Medium>
|
||||||
val shouldShowHidden = config.shouldShowHidden
|
val shouldShowHidden = config.shouldShowHidden
|
||||||
var filteredMedia = media
|
var filteredMedia = media
|
||||||
if (!shouldShowHidden) {
|
if (!shouldShowHidden) {
|
||||||
|
@ -297,6 +297,7 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
|
||||||
mediumDao.deleteMediumPath(it.path)
|
mediumDao.deleteMediumPath(it.path)
|
||||||
}
|
}
|
||||||
}.start()
|
}.start()
|
||||||
|
}
|
||||||
|
|
||||||
fun Context.removeInvalidDirectories(dirs: ArrayList<Directory>? = null, directoryDao: DirectoryDao = galleryDB.DirectoryDao()) {
|
fun Context.removeInvalidDirectories(dirs: ArrayList<Directory>? = null, directoryDao: DirectoryDao = galleryDB.DirectoryDao()) {
|
||||||
val dirsToCheck = dirs ?: directoryDao.getAll()
|
val dirsToCheck = dirs ?: directoryDao.getAll()
|
||||||
|
|
Loading…
Reference in a new issue