try adding files in the mediastore if updating Date Taken fails

This commit is contained in:
tibbi 2018-12-26 20:54:46 +01:00
parent f74302d889
commit ca450e8f18

View file

@ -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()