filter out videos from directory cover images immediately

This commit is contained in:
tibbi 2017-10-19 17:05:59 +02:00
parent ebe0ed68fd
commit 906168c6b5

View file

@ -30,7 +30,8 @@ class PickMediumDialog(val activity: SimpleActivity, val path: String, val callb
activity.setupDialogStuff(view, this, R.string.select_photo) activity.setupDialogStuff(view, this, R.string.select_photo)
val token = object : TypeToken<List<Medium>>() {}.type val token = object : TypeToken<List<Medium>>() {}.type
val media = Gson().fromJson<ArrayList<Medium>>(activity.config.loadFolderMedia(path), token) ?: ArrayList(1) var media = Gson().fromJson<ArrayList<Medium>>(activity.config.loadFolderMedia(path), token) ?: ArrayList(1)
media = media.filter { !it.video } as ArrayList
if (media.isNotEmpty()) { if (media.isNotEmpty()) {
gotMedia(media) gotMedia(media)