catching an exception at storing path in db
This commit is contained in:
parent
a17d6c5be4
commit
86fe77834c
1 changed files with 4 additions and 1 deletions
|
@ -716,6 +716,9 @@ fun Context.addPathToDB(path: String) {
|
||||||
val videoDuration = if (type == TYPE_VIDEOS) path.getVideoDuration() else 0
|
val videoDuration = if (type == TYPE_VIDEOS) path.getVideoDuration() else 0
|
||||||
val medium = Medium(null, path.getFilenameFromPath(), path, path.getParentPath(), System.currentTimeMillis(), System.currentTimeMillis(),
|
val medium = Medium(null, path.getFilenameFromPath(), path, path.getParentPath(), System.currentTimeMillis(), System.currentTimeMillis(),
|
||||||
File(path).length(), type, videoDuration, false, 0L)
|
File(path).length(), type, videoDuration, false, 0L)
|
||||||
|
try {
|
||||||
galleryDB.MediumDao().insert(medium)
|
galleryDB.MediumDao().insert(medium)
|
||||||
|
} catch (ignored: Exception) {
|
||||||
|
}
|
||||||
}.start()
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue