if no Date Taken values have been fixed, show an error, not success

This commit is contained in:
tibbi 2018-11-19 12:51:47 +01:00
parent cdf87c0038
commit de9d7f580f
1 changed files with 3 additions and 1 deletions

View File

@ -313,6 +313,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
activity.toast(R.string.fixing)
Thread {
try {
var didUpdateFile = false
val operations = ArrayList<ContentProviderOperation>()
val mediumDao = activity.galleryDB.MediumDao()
val paths = getSelectedPaths()
@ -343,10 +344,11 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList<Thumbnai
}
mediumDao.updateFavoriteDateTaken(path, timestamp)
didUpdateFile = true
}
activity.contentResolver.applyBatch(MediaStore.AUTHORITY, operations)
activity.toast(R.string.dates_fixed_successfully)
activity.toast(if (didUpdateFile) R.string.dates_fixed_successfully else R.string.unknown_error_occurred)
activity.runOnUiThread {
listener?.refreshItems()
finishActMode()