feat(Playlist): display views and upload date

As the Piped API now provides the number of views/upload date for a playlist item, we can
display them in the playlist view.

Ref: https://github.com/libre-tube/LibreTube/issues/4401
This commit is contained in:
FineFindus 2025-01-05 21:22:39 +01:00
parent 5cc221c927
commit d0d9debc29
No known key found for this signature in database
GPG Key ID: 64873EE210FF8E6B

View File

@ -80,12 +80,14 @@ class PlaylistAdapter(
holder.binding.apply { holder.binding.apply {
videoTitle.text = streamItem.title videoTitle.text = streamItem.title
videoInfo.text = streamItem.uploaderName videoInfo.text = TextUtils.formatViewsString(root.context, streamItem.views ?: -1, streamItem.uploaded, streamItem.uploaderName)
channelImageContainer.isGone = true videoInfo.maxLines = 2
thumbnailDuration.setFormattedDuration(streamItem.duration ?: -1, streamItem.isShort, streamItem.uploaded) // piped does not load channel avatars for playlist views
channelContainer.isGone = true
ImageHelper.loadImage(streamItem.thumbnail, thumbnail) ImageHelper.loadImage(streamItem.thumbnail, thumbnail)
thumbnailDuration.setFormattedDuration(streamItem.duration ?: -1, streamItem.isShort, streamItem.uploaded)
root.setOnClickListener { root.setOnClickListener {
NavigationHelper.navigateVideo(root.context, streamItem.url, playlistId) NavigationHelper.navigateVideo(root.context, streamItem.url, playlistId)