catch some exceptions at inserting folders in db
This commit is contained in:
parent
e7174f9001
commit
8bbc498724
1 changed files with 9 additions and 8 deletions
|
@ -1030,16 +1030,17 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
|||
val newDir = createDirectoryFromMedia(folder, newMedia, albumCovers, hiddenString, includedFolders, getProperFileSize)
|
||||
dirs.add(newDir)
|
||||
setupAdapter(dirs)
|
||||
try {
|
||||
|
||||
// make sure to create a new thread for these operations, dont just use the common bg thread
|
||||
Thread {
|
||||
try {
|
||||
directoryDao.insert(newDir)
|
||||
if (folder != RECYCLE_BIN) {
|
||||
mediaDB.insertAll(newMedia)
|
||||
}
|
||||
}.start()
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
}.start()
|
||||
}
|
||||
|
||||
mLoadedInitialPhotos = true
|
||||
|
|
Loading…
Reference in a new issue