make sure the file is a video, before getting its duration

This commit is contained in:
tibbi 2018-12-01 11:41:02 +01:00
parent 8c97d7952a
commit 33301d6282

View file

@ -232,7 +232,7 @@ class MediaFetcher(val context: Context) {
} else { } else {
val lastModified = file.lastModified() val lastModified = file.lastModified()
var dateTaken = lastModified var dateTaken = lastModified
val videoDuration = if (getVideoDurations) path.getVideoDuration() else 0 val videoDuration = if (getVideoDurations && isVideo) path.getVideoDuration() else 0
if (getProperDateTaken) { if (getProperDateTaken) {
dateTaken = dateTakens.remove(filename) ?: lastModified dateTaken = dateTakens.remove(filename) ?: lastModified