From b4290375b88351ca3443bf44441ea8e5866e4cf5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 23 Mar 2017 18:38:41 +0100 Subject: [PATCH] use the new mimetype getter at Mediums --- .../kotlin/com/simplemobiletools/gallery/models/Medium.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt index 5abab20e0..b6749ca50 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -1,11 +1,12 @@ package com.simplemobiletools.gallery.models +import com.simplemobiletools.commons.extensions.getMimeType import com.simplemobiletools.commons.extensions.isGif -import com.simplemobiletools.commons.extensions.isPng import com.simplemobiletools.commons.helpers.SORT_BY_DATE_MODIFIED import com.simplemobiletools.commons.helpers.SORT_BY_NAME import com.simplemobiletools.commons.helpers.SORT_BY_SIZE import com.simplemobiletools.commons.helpers.SORT_DESCENDING +import java.io.File import java.io.Serializable data class Medium(val name: String, var path: String, val isVideo: Boolean, val date_modified: Long, val date_taken: Long, val size: Long) : Serializable, Comparable { @@ -16,11 +17,9 @@ data class Medium(val name: String, var path: String, val isVideo: Boolean, val fun isGif() = path.isGif() - fun isPng() = path.isPng() - fun isImage() = !isGif() && !isVideo - fun getMimeType() = if (isVideo) "video/*" else "image/*" + fun getMimeType() = File(path).getMimeType() override fun compareTo(other: Medium): Int { var res: Int