lets try rescanning all paths at "Fix Date Taken values", before updating them
This commit is contained in:
parent
c7f57842c8
commit
2d34288550
|
@ -330,6 +330,7 @@ fun Activity.fixDateTaken(paths: ArrayList<String>, callback: (() -> Unit)? = nu
|
|||
var didUpdateFile = false
|
||||
val operations = ArrayList<ContentProviderOperation>()
|
||||
val mediumDao = galleryDB.MediumDao()
|
||||
rescanPaths(paths) {
|
||||
for (path in paths) {
|
||||
val dateTime = ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME_ORIGINAL)
|
||||
?: ExifInterface(path).getAttribute(ExifInterface.TAG_DATETIME) ?: continue
|
||||
|
@ -363,13 +364,13 @@ fun Activity.fixDateTaken(paths: ArrayList<String>, callback: (() -> Unit)? = nu
|
|||
val resultSize = contentResolver.applyBatch(MediaStore.AUTHORITY, operations).size
|
||||
if (resultSize == 0) {
|
||||
didUpdateFile = false
|
||||
rescanPaths(paths)
|
||||
}
|
||||
|
||||
toast(if (didUpdateFile) R.string.dates_fixed_successfully else R.string.unknown_error_occurred)
|
||||
runOnUiThread {
|
||||
callback?.invoke()
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
showErrorToast(e)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue