mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +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 {
|
binding.apply {
|
||||||
ImageHelper.loadImage(item.thumbnail, searchChannelImage)
|
ImageHelper.loadImage(item.thumbnail, searchChannelImage)
|
||||||
searchChannelName.text = item.name
|
searchChannelName.text = item.name
|
||||||
searchViews.text = root.context.getString(
|
|
||||||
R.string.subscribers,
|
searchViews.text = listOfNotNull(
|
||||||
item.subscribers.formatShort()
|
root.context.getString(
|
||||||
) + TextUtils.SEPARATOR + root.context.getString(
|
R.string.subscribers,
|
||||||
R.string.videoCount,
|
item.subscribers.formatShort()
|
||||||
item.videos.toString()
|
).takeIf { item.subscribers >= 0 },
|
||||||
)
|
root.context.getString(
|
||||||
|
R.string.videoCount,
|
||||||
|
item.videos.toString()
|
||||||
|
).takeIf { item.videos >= 0 }
|
||||||
|
).joinToString(TextUtils.SEPARATOR)
|
||||||
|
|
||||||
root.setOnClickListener {
|
root.setOnClickListener {
|
||||||
NavigationHelper.navigateChannel(root.context, item.url)
|
NavigationHelper.navigateChannel(root.context, item.url)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user