mirror of
https://github.com/gabehf/music-importer.git
synced 2026-04-22 11:31:52 -07:00
better release search. artist search just ok
This commit is contained in:
parent
4324de1271
commit
eca7f4ba31
8 changed files with 121 additions and 38 deletions
|
|
@ -100,10 +100,14 @@ function renderRelease(r) {
|
|||
const artist = credits.map(c => c.name || c.artist?.name || '').join('') || 'Unknown Artist';
|
||||
const year = r.date?.substring(0, 4) ?? '';
|
||||
const type = r['release-group']?.['primary-type'] ?? '';
|
||||
const meta = [year, type].filter(Boolean).join(' \u00b7 ');
|
||||
const country = r.country ?? '';
|
||||
const formats = [...new Set((r.media ?? []).map(m => m.format).filter(Boolean))].join('+');
|
||||
const meta = [year, type, formats, country].filter(Boolean).join(' \u00b7 ');
|
||||
const coverUrl = `https://coverartarchive.org/release/${r.id}/front-250`;
|
||||
|
||||
return `
|
||||
<div class="result-row">
|
||||
<img class="result-cover" src="${coverUrl}" onerror="this.style.display='none'" loading="lazy" alt="">
|
||||
<div class="result-info">
|
||||
<span class="result-title">${esc(artist)} \u2014 ${esc(r.title)}</span>
|
||||
${meta ? `<span class="result-meta">${esc(meta)}</span>` : ''}
|
||||
|
|
|
|||
|
|
@ -332,6 +332,14 @@ h1 {
|
|||
padding: 12px 16px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.result-cover {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
object-fit: cover;
|
||||
border-radius: var(--radius-sm);
|
||||
flex-shrink: 0;
|
||||
background: var(--surface-hi);
|
||||
}
|
||||
.result-info { flex: 1; min-width: 0; }
|
||||
.result-title {
|
||||
display: block;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue