From d5d35ab85e5608ac4485ead9eb2e6d76645effa5 Mon Sep 17 00:00:00 2001 From: ghassan Date: Wed, 21 Oct 2026 10:37:01 +0300 Subject: [PATCH] fix(channel): pluralise video counts, hide stray "0.0" from playlist meta - Playlist cards on the channel page used Number::abbreviate for the view count, which prints "0.0" (precision=1) when the playlist has never been viewed. Hide the whole view-count row for zero-view playlists; still show "1.2K" / "2.3M" when there's traffic. - "N videos" counts (header meta row + per-playlist count) now use Str::plural so "1 video" renders correctly instead of "1 videos". Co-Authored-By: Claude Opus 4.7 (1M context) --- resources/views/user/channel.blade.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/resources/views/user/channel.blade.php b/resources/views/user/channel.blade.php index 57d503b..67707b2 100644 --- a/resources/views/user/channel.blade.php +++ b/resources/views/user/channel.blade.php @@ -122,7 +122,8 @@ $headerSocialMap = [
- {{ number_format($videos->count() + $shorts->count()) }} videos + @php $vidTotal = $videos->count() + $shorts->count(); @endphp + {{ number_format($vidTotal) }} {{ Str::plural('video', $vidTotal) }} · @@ -780,8 +781,8 @@ $headerSocialMap = [ @endif
- - {{ $playlist->video_count }} videos + + {{ $playlist->video_count }} {{ Str::plural('video', $playlist->video_count) }}
{{ $playlist->name }}
@@ -795,7 +796,13 @@ $headerSocialMap = [ @else Public @endif - · {{ \Illuminate\Support\Number::abbreviate($playlist->view_count, precision: 1) }} + {{-- Hide the view-count row entirely when the playlist has + never been viewed. Previously showed "· eye 0.0" because + Number::abbreviate(0, precision: 1) prints "0.0". --}} + @if($playlist->view_count > 0) + · + {{ \Illuminate\Support\Number::abbreviate($playlist->view_count, precision: 1) }} + @endif @endforeach