Show album covers when importing/scanning

This commit is contained in:
Claudio Ortolina
2025-03-01 17:36:21 +00:00
parent 93f6b260b2
commit 2f5c83b026
5 changed files with 32 additions and 14 deletions
@@ -1,6 +1,7 @@
defmodule MusicLibraryWeb.BarcodeScannerComponent do
use MusicLibraryWeb, :live_component
alias MusicBrainz.ReleaseGroupSearchResult
alias MusicLibrary.Records
alias MusicLibraryWeb.RecordComponents
@@ -100,6 +101,12 @@ defmodule MusicLibraryWeb.BarcodeScannerComponent do
defp release(assigns) do
~H"""
<div class="flex items-center justify-between w-full px-4">
<img
class="w-20 flex-none rounded-lg mr-4"
alt={@release.release_group.title}
src={ReleaseGroupSearchResult.thumb_url(@release.release_group)}
onerror={"this.src = '" <> ~p"/images/cover-not-found.png" <> "';"}
/>
<div class="min-w-0 flex-auto">
<h1 class="text-sm leading-6 text-zinc-700 dark:text-zinc-400">
{@release.artists}