adding some crashfixes
This commit is contained in:
parent
115eaa1e97
commit
503da545fc
2 changed files with 7 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue