mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-09 08:38:40 +01:00
fix #913, at fixing the Date Taken value update it at Favorite items too
This commit is contained in:
parent
f01410bb1e
commit
0ced7023f1
@ -292,6 +292,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
|
||||
Thread {
|
||||
try {
|
||||
val operations = ArrayList<ContentProviderOperation>()
|
||||
val mediumDao = activity.galleryDB.MediumDao()
|
||||
val paths = getSelectedPaths()
|
||||
for (path in paths) {
|
||||
val dateTime = ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME) ?: continue
|
||||
@ -312,6 +313,8 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
|
||||
activity.contentResolver.applyBatch(MediaStore.AUTHORITY, operations)
|
||||
operations.clear()
|
||||
}
|
||||
|
||||
mediumDao.updateFavoriteDateTaken(path, timestamp)
|
||||
}
|
||||
|
||||
activity.contentResolver.applyBatch(MediaStore.AUTHORITY, operations)
|
||||
|
@ -38,6 +38,9 @@ interface MediumDao {
|
||||
@Query("UPDATE media SET deleted_ts = :deletedTS WHERE full_path = :path COLLATE NOCASE")
|
||||
fun updateDeleted(path: String, deletedTS: Long)
|
||||
|
||||
@Query("UPDATE media SET date_taken = :dateTaken WHERE full_path = :path COLLATE NOCASE")
|
||||
fun updateFavoriteDateTaken(path: String, dateTaken: Long)
|
||||
|
||||
@Query("DELETE FROM media WHERE deleted_ts != 0")
|
||||
fun clearRecycleBin()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user