show a better error message at fixing date taken values, if none found

This commit is contained in:
tibbi 2020-02-23 11:50:16 +01:00
parent 17e7fb523d
commit e2021bcc54
2 changed files with 9 additions and 1 deletions

View File

@ -453,6 +453,14 @@ fun Activity.fixDateTaken(paths: ArrayList<String>, showToasts: Boolean, hasResc
} }
} }
if (!didUpdateFile) {
toast(R.string.no_date_takens_found)
runOnUiThread {
callback?.invoke()
}
return@ensureBackgroundThread
}
val resultSize = contentResolver.applyBatch(MediaStore.AUTHORITY, operations).size val resultSize = contentResolver.applyBatch(MediaStore.AUTHORITY, operations).size
if (resultSize == 0) { if (resultSize == 0) {
didUpdateFile = false didUpdateFile = false

View File

@ -958,7 +958,7 @@ fun Context.getFileDateTaken(path: String): Long {
do { do {
try { try {
return cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN) return cursor.getLongValue(MediaStore.Images.Media.DATE_TAKEN)
} catch (e: Exception) { } catch (ignored: Exception) {
} }
} while (cursor.moveToNext()) } while (cursor.moveToNext())
} }