catching an exception at inserting directories in db
This commit is contained in:
parent
a4b42b5522
commit
29e1220c84
|
@ -915,7 +915,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
val newDir = createDirectoryFromMedia(folder, newMedia, albumCovers, hiddenString, includedFolders, isSortingAscending)
|
val newDir = createDirectoryFromMedia(folder, newMedia, albumCovers, hiddenString, includedFolders, isSortingAscending)
|
||||||
dirs.add(newDir)
|
dirs.add(newDir)
|
||||||
setupAdapter(dirs)
|
setupAdapter(dirs)
|
||||||
|
try {
|
||||||
mDirectoryDao.insert(newDir)
|
mDirectoryDao.insert(newDir)
|
||||||
|
} catch (ignored: Exception) {
|
||||||
|
}
|
||||||
if (folder != RECYCLE_BIN) {
|
if (folder != RECYCLE_BIN) {
|
||||||
mMediumDao.insertAll(newMedia)
|
mMediumDao.insertAll(newMedia)
|
||||||
}
|
}
|
||||||
|
@ -1075,7 +1078,8 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
|
|
||||||
private fun getCurrentlyDisplayedDirs() = getRecyclerAdapter()?.dirs ?: ArrayList()
|
private fun getCurrentlyDisplayedDirs() = getRecyclerAdapter()?.dirs ?: ArrayList()
|
||||||
|
|
||||||
private fun getBubbleTextItem(index: Int) = getRecyclerAdapter()?.dirs?.getOrNull(index)?.getBubbleText(config.directorySorting, this) ?: ""
|
private fun getBubbleTextItem(index: Int) = getRecyclerAdapter()?.dirs?.getOrNull(index)?.getBubbleText(config.directorySorting, this)
|
||||||
|
?: ""
|
||||||
|
|
||||||
private fun setupLatestMediaId() {
|
private fun setupLatestMediaId() {
|
||||||
Thread {
|
Thread {
|
||||||
|
|
Loading…
Reference in New Issue