make sure we clean up invalid recycle bin db entries
This commit is contained in:
parent
59cb293d98
commit
ed8fa63ce8
|
@ -364,9 +364,14 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
|
|||
val grouped = mediaFetcher.groupMedia(media, path)
|
||||
callback(grouped.clone() as ArrayList<ThumbnailItem>)
|
||||
|
||||
val recycleBinPath = filesDir.toString()
|
||||
media.filter { !getDoesFilePathExist(it.path) }.forEach {
|
||||
if (it.path.startsWith(recycleBinPath)) {
|
||||
mediumDao.deleteMediumPath(it.path.removePrefix(recycleBinPath))
|
||||
} else {
|
||||
mediumDao.deleteMediumPath(it.path)
|
||||
}
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue