From 34013ef119d75bc74065f1573ff76d1ed60984dc Mon Sep 17 00:00:00 2001
From: Claudio Ortolina
Date: Sat, 14 Jun 2025 12:24:35 +0300
Subject: [PATCH] Use badges for top albums count
---
.../live/stats_live/index.ex | 22 +++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/lib/music_library_web/live/stats_live/index.ex b/lib/music_library_web/live/stats_live/index.ex
index 2d77fd06..0f8f0b7c 100644
--- a/lib/music_library_web/live/stats_live/index.ex
+++ b/lib/music_library_web/live/stats_live/index.ex
@@ -120,9 +120,27 @@ defmodule MusicLibraryWeb.StatsLive.Index do
{album.album_title}
-
+ <.badge :if={album.album_musicbrainz_id == ""}>
{album.play_count}
-
+
+ <.badge :if={
+ album.album_musicbrainz_id !== "" and
+ !tracked_record?(
+ @collected_releases ++ @wishlisted_releases,
+ album.album_musicbrainz_id
+ )
+ }>
+ {album.play_count}
+
+ <.badge :if={tracked_record?(@collected_releases, album.album_musicbrainz_id)} color="green">
+ {album.play_count}
+
+ <.badge
+ :if={tracked_record?(@wishlisted_releases, album.album_musicbrainz_id)}
+ color="yellow"
+ >
+ {album.play_count}
+