mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
fix #1818, be less agressive at Favorite items cleanup
This commit is contained in:
parent
6c77382f60
commit
0d01533231
1 changed files with 1 additions and 1 deletions
|
@ -606,6 +606,7 @@ fun Context.getCachedMedia(path: String, getVideosOnly: Boolean = false, getImag
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val mediaToDelete = ArrayList<Medium>()
|
val mediaToDelete = ArrayList<Medium>()
|
||||||
|
// creating a new thread intentionally, do not reuse the common background thread
|
||||||
Thread {
|
Thread {
|
||||||
media.filter { !getDoesFilePathExist(it.path, OTGPath) }.forEach {
|
media.filter { !getDoesFilePathExist(it.path, OTGPath) }.forEach {
|
||||||
if (it.path.startsWith(recycleBinPath)) {
|
if (it.path.startsWith(recycleBinPath)) {
|
||||||
|
@ -699,7 +700,6 @@ fun Context.deleteDBPath(path: String) {
|
||||||
fun Context.deleteMediumWithPath(path: String) {
|
fun Context.deleteMediumWithPath(path: String) {
|
||||||
try {
|
try {
|
||||||
mediaDB.deleteMediumPath(path)
|
mediaDB.deleteMediumPath(path)
|
||||||
favoritesDB.deleteFavoritePath(path)
|
|
||||||
} catch (ignored: Exception) {
|
} catch (ignored: Exception) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue