mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-18 06:17:59 +01:00
catching some exceptions thrown at inserting media in db
This commit is contained in:
parent
668df3b8fb
commit
3c8ec82bc7
1 changed files with 5 additions and 2 deletions
|
@ -958,11 +958,14 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
||||||
|
|
||||||
setupAdapter(dirs)
|
setupAdapter(dirs)
|
||||||
|
|
||||||
// update directories and media files in the local db, delete invalid items
|
// update directories and media files in the local db, delete invalid items. Intentionally creating a new thread
|
||||||
updateDBDirectory(directory)
|
updateDBDirectory(directory)
|
||||||
if (!directory.isRecycleBin()) {
|
if (!directory.isRecycleBin()) {
|
||||||
Thread {
|
Thread {
|
||||||
mediaDB.insertAll(curMedia)
|
try {
|
||||||
|
mediaDB.insertAll(curMedia)
|
||||||
|
} catch (ignored: Exception) {
|
||||||
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue