mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
adding some crashfixes
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user