mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
Merge pull request #3220 from Bnyro/master
Fix negative subscriber and views count for channels
This commit is contained in:
commit
3368708609
@ -109,13 +109,18 @@ class SearchAdapter : ListAdapter<ContentItem, SearchViewHolder>(SearchCallback)
|
||||
binding.apply {
|
||||
ImageHelper.loadImage(item.thumbnail, searchChannelImage)
|
||||
searchChannelName.text = item.name
|
||||
searchViews.text = root.context.getString(
|
||||
R.string.subscribers,
|
||||
item.subscribers.formatShort()
|
||||
) + TextUtils.SEPARATOR + root.context.getString(
|
||||
R.string.videoCount,
|
||||
item.videos.toString()
|
||||
)
|
||||
|
||||
searchViews.text = listOfNotNull(
|
||||
root.context.getString(
|
||||
R.string.subscribers,
|
||||
item.subscribers.formatShort()
|
||||
).takeIf { item.subscribers >= 0 },
|
||||
root.context.getString(
|
||||
R.string.videoCount,
|
||||
item.videos.toString()
|
||||
).takeIf { item.videos >= 0 }
|
||||
).joinToString(TextUtils.SEPARATOR)
|
||||
|
||||
root.setOnClickListener {
|
||||
NavigationHelper.navigateChannel(root.context, item.url)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user