mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
really clear all Favorites at deleting the given folder
This commit is contained in:
@@ -555,6 +555,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
|||||||
tryEmptyRecycleBin(false)
|
tryEmptyRecycleBin(false)
|
||||||
} else {
|
} else {
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
|
activity.mediaDB.clearFavorites()
|
||||||
activity.favoritesDB.clearFavorites()
|
activity.favoritesDB.clearFavorites()
|
||||||
listener?.refreshItems()
|
listener?.refreshItems()
|
||||||
}
|
}
|
||||||
|
@@ -42,6 +42,9 @@ interface MediumDao {
|
|||||||
@Query("UPDATE media SET date_taken = :dateTaken WHERE full_path = :path COLLATE NOCASE")
|
@Query("UPDATE media SET date_taken = :dateTaken WHERE full_path = :path COLLATE NOCASE")
|
||||||
fun updateFavoriteDateTaken(path: String, dateTaken: Long)
|
fun updateFavoriteDateTaken(path: String, dateTaken: Long)
|
||||||
|
|
||||||
|
@Query("UPDATE media SET is_favorite = 0")
|
||||||
|
fun clearFavorites()
|
||||||
|
|
||||||
@Query("DELETE FROM media WHERE deleted_ts != 0")
|
@Query("DELETE FROM media WHERE deleted_ts != 0")
|
||||||
fun clearRecycleBin()
|
fun clearRecycleBin()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user