From bf78f456d4a9ff83d48d044b1b2132659c14f1ea Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sun, 5 Jan 2025 21:18:46 +0000 Subject: [PATCH] Convert records in artist page to a stream --- .../live/artist_live/record_components.ex | 6 ++++-- lib/music_library_web/live/artist_live/show.ex | 6 ++++-- lib/music_library_web/live/artist_live/show.html.heex | 10 ++++++---- priv/gettext/default.pot | 8 ++++---- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/music_library_web/live/artist_live/record_components.ex b/lib/music_library_web/live/artist_live/record_components.ex index 34bd2161..9b837932 100644 --- a/lib/music_library_web/live/artist_live/record_components.ex +++ b/lib/music_library_web/live/artist_live/record_components.ex @@ -4,6 +4,7 @@ defmodule MusicLibraryWeb.ArtistLive.RecordComponents do alias MusicLibrary.Records attr :records, :list, required: true + attr :records_count, :integer, required: true attr :title, :string, required: true attr :id, :string, required: true attr :record_path, :any, required: true @@ -17,16 +18,17 @@ defmodule MusicLibraryWeb.ArtistLive.RecordComponents do {gettext("Number of records")} - <.round_badge text={Enum.count(@records)} /> + <.round_badge text={@records_count} /> <%!-- TODO: replace with OSS version --%>