catching an exception at storing path in db

This commit is contained in:
tibbi 2019-03-13 11:44:13 +01:00
parent a17d6c5be4
commit 86fe77834c

View file

@ -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)
galleryDB.MediumDao().insert(medium) try {
galleryDB.MediumDao().insert(medium)
} catch (ignored: Exception) {
}
}.start() }.start()
} }