@@ -3,6 +3,7 @@ package com.github.libretube.ui.adapters
33import android.view.LayoutInflater
44import android.view.ViewGroup
55import androidx.core.os.bundleOf
6+ import androidx.core.view.isGone
67import androidx.core.view.isVisible
78import androidx.paging.PagingDataAdapter
89import com.github.libretube.R
@@ -91,10 +92,12 @@ class SearchResultsAdapter(
9192 private fun bindVideo (item : ContentItem , binding : VideoRowBinding , position : Int ) {
9293 binding.apply {
9394 ImageHelper .loadImage(item.thumbnail, thumbnail)
95+
9496 thumbnailDuration.setFormattedDuration(item.duration, item.isShort, item.uploaded)
9597 videoTitle.text = item.title
9698 videoInfo.text = TextUtils .formatViewsString(root.context, item.views, item.uploaded)
9799
100+ channelContainer.isGone = item.uploaderAvatar.isNullOrEmpty()
98101 channelName.text = item.uploaderName
99102 ImageHelper .loadImage(item.uploaderAvatar, channelImage, true )
100103
@@ -184,12 +187,10 @@ class SearchResultsAdapter(
184187 }
185188
186189 root.setOnLongClickListener {
187- val playlistId = item.url.toID()
188- val playlistName = item.name!!
189190 val sheet = PlaylistOptionsBottomSheet ()
190191 sheet.arguments = bundleOf(
191- IntentData .playlistId to playlistId ,
192- IntentData .playlistName to playlistName ,
192+ IntentData .playlistId to item.url.toID() ,
193+ IntentData .playlistName to item.name.orEmpty() ,
193194 IntentData .playlistType to PlaylistType .PUBLIC
194195 )
195196 sheet.show(
0 commit comments