Normalize display of artist names

This commit is contained in:
Claudio Ortolina
2024-10-07 14:57:30 +01:00
parent 764c4cebb3
commit ddbda5b4d2
7 changed files with 14 additions and 3 deletions
@@ -1,6 +1,7 @@
defmodule MusicLibraryWeb.RecordLive.Index do
use MusicLibraryWeb, :live_view
import MusicLibraryWeb.Pagination
import MusicLibraryWeb.ArtistHelpers
alias MusicLibrary.Records
@@ -36,7 +36,7 @@
</span>
</:col>
<:col :let={{_id, record}}>
<p class="text-sm max-sm:text-xs"><%= Enum.map(record.artists, fn a -> a.name end) %></p>
<p class="text-sm max-sm:text-xs"><%= format_artist_names(record.artists) %></p>
<p class="text-base font-semibold text-wrap max-sm:text-xs"><%= record.title %></p>
<p class="text-sm max-sm:text-xs"><%= record.release %></p>
</:col>
@@ -1,5 +1,6 @@
defmodule MusicLibraryWeb.RecordLive.Show do
use MusicLibraryWeb, :live_view
import MusicLibraryWeb.ArtistHelpers
alias MusicLibrary.Records
@@ -1,6 +1,6 @@
<.header>
<%= @record.title %>
<:subtitle><%= Enum.map(@record.artists, fn a -> a.name end) %></:subtitle>
<:subtitle><%= format_artist_names(@record.artists) %></:subtitle>
<:actions>
<.link patch={~p"/records/#{@record}/show/edit"} phx-click={JS.push_focus()}>
<.button>Edit Metadata</.button>