mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
try adding files in the mediastore if updating Date Taken fails
This commit is contained in:
parent
f74302d889
commit
ca450e8f18
1 changed files with 6 additions and 1 deletions
|
@ -349,7 +349,12 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
|
|||
didUpdateFile = true
|
||||
}
|
||||
|
||||
activity.contentResolver.applyBatch(MediaStore.AUTHORITY, operations)
|
||||
val resultSize = activity.contentResolver.applyBatch(MediaStore.AUTHORITY, operations).size
|
||||
if (resultSize == 0) {
|
||||
didUpdateFile = false
|
||||
activity.rescanPaths(paths)
|
||||
}
|
||||
|
||||
activity.toast(if (didUpdateFile) R.string.dates_fixed_successfully else R.string.unknown_error_occurred)
|
||||
activity.runOnUiThread {
|
||||
listener?.refreshItems()
|
||||
|
|
Loading…
Reference in a new issue