From 83d9efeafd42e0ec276540fa89967107a8ddb42f Mon Sep 17 00:00:00 2001 From: Bnyro Date: Fri, 20 Dec 2024 19:42:28 +0100 Subject: [PATCH] fix: only display playlist video count if ge zero --- .../com/github/libretube/ui/fragments/PlaylistFragment.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt index fa6fc0a11..6536be892 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlaylistFragment.kt @@ -378,9 +378,10 @@ class PlaylistFragment : DynamicLayoutManagerFragment() { @SuppressLint("StringFormatInvalid", "StringFormatMatches") private fun getChannelAndVideoString(playlist: Playlist, count: Int): String { - return playlist.uploader?.let { - getString(R.string.uploaderAndVideoCount, it, count) - } ?: getString(R.string.videoCount, count) + if (count < 0) return playlist.uploader.orEmpty() + if (playlist.uploader == null) return getString(R.string.videoCount, count) + + return getString(R.string.uploaderAndVideoCount, playlist.uploader, count) } private fun fetchNextPage() {