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 {
|
ensureBackgroundThread {
|
||||||
val oldMedia = mMedia.clone() as ArrayList<ThumbnailItem>
|
val oldMedia = mMedia.clone() as ArrayList<ThumbnailItem>
|
||||||
val newMedia = it
|
val newMedia = it
|
||||||
gotMedia(newMedia, false)
|
|
||||||
try {
|
try {
|
||||||
|
gotMedia(newMedia, false)
|
||||||
oldMedia.filter { !newMedia.contains(it) }.mapNotNull { it as? Medium }.filter { !File(it.path).exists() }.forEach {
|
oldMedia.filter { !newMedia.contains(it) }.mapNotNull { it as? Medium }.filter { !File(it.path).exists() }.forEach {
|
||||||
mMediumDao.deleteMediumPath(it.path)
|
mMediumDao.deleteMediumPath(it.path)
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,8 +193,12 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
||||||
}
|
}
|
||||||
updateDirs(dirs)
|
updateDirs(dirs)
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
activity.galleryDB.DirectoryDao().updateDirectoryAfterRename(firstDir.tmb, firstDir.name, firstDir.path, sourcePath)
|
try {
|
||||||
listener?.refreshItems()
|
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