fix #913, at fixing the Date Taken value update it at Favorite items too
This commit is contained in:
parent
f01410bb1e
commit
0ced7023f1
2 changed files with 6 additions and 0 deletions
|
@ -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…
Reference in a new issue