adding some crashfixes

This commit is contained in:
tibbi 2019-10-27 10:52:34 +01:00
parent 115eaa1e97
commit 503da545fc
2 changed files with 7 additions and 3 deletions

View file

@ -604,8 +604,8 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
ensureBackgroundThread {
val oldMedia = mMedia.clone() as ArrayList<ThumbnailItem>
val newMedia = it
gotMedia(newMedia, false)
try {
gotMedia(newMedia, false)
oldMedia.filter { !newMedia.contains(it) }.mapNotNull { it as? Medium }.filter { !File(it.path).exists() }.forEach {
mMediumDao.deleteMediumPath(it.path)
}

View file

@ -193,8 +193,12 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
}
updateDirs(dirs)
ensureBackgroundThread {
activity.galleryDB.DirectoryDao().updateDirectoryAfterRename(firstDir.tmb, firstDir.name, firstDir.path, sourcePath)
listener?.refreshItems()
try {
activity.galleryDB.DirectoryDao().updateDirectoryAfterRename(firstDir.tmb, firstDir.name, firstDir.path, sourcePath)
listener?.refreshItems()
} catch (e: Exception) {
activity.showErrorToast(e)
}
}
}
}