library: file a record you don't own off the payload's own field names
The gap cards were reading `nb_tracks` and `date`, which are the shapes the prototype's generated collection.json used, not the ones CatalogAlbum actually carries — `track_count` and `release_date`. The year chip survived on a fallback; the track count reached the classifier as undefined, so the floor under it had nothing to weigh and every gap card leaned entirely on Deezer's record_type. They also now pass `is_live` and `is_soundtrack` through. Deezer has no record type for either, and the backend sets those flags from the tracklist and the Films/Games genre precisely so a live album that omits "Live" from its title can still be recognised — the artist page reads them, and there is no reason the same record filed on this page should not.
This commit is contained in:
1 parent
f55052506a
commit
741c4ae6dc
1 file changed
+16
-7
@@ -988,10 +988,23 @@
|
||||
{/snippet}
|
||||
|
||||
{#snippet gapCard(r)}
|
||||
<!-- A record you do NOT own, at full size and dimmed. It is filed by the
|
||||
same classifier as everything else, off the CatalogAlbum payload's own
|
||||
fields (`record_type`/`track_count`/`release_date`, plus the is_live and
|
||||
is_soundtrack flags Deezer has no record type for) — "other" means the
|
||||
classifier had nothing to go on, so it is left unsaid rather than
|
||||
printed under every card. -->
|
||||
{@const cat = fileRelease({
|
||||
title: r.title,
|
||||
record_type: r.record_type,
|
||||
track_count: r.track_count,
|
||||
is_live: r.is_live,
|
||||
is_soundtrack: r.is_soundtrack,
|
||||
})}
|
||||
<div class="release gap" role="listitem" title={`${r.title} — not in your library`}>
|
||||
<div class="cover-wrap">
|
||||
{#if r.date?.slice(0, 4) || r.release_date?.slice(0, 4)}
|
||||
<span class="ed-badge">{(r.release_date ?? r.date).slice(0, 4)}</span>
|
||||
{#if r.release_date?.slice(0, 4)}
|
||||
<span class="ed-badge">{r.release_date.slice(0, 4)}</span>
|
||||
{/if}
|
||||
{#if r.cover}
|
||||
<img class="cover" src={r.cover} alt="" loading="lazy" draggable="false" />
|
||||
@@ -1000,11 +1013,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
<div class="title" title={r.title}>{r.title}</div>
|
||||
<div class="sub">
|
||||
{#if fileRelease({ title: r.title, record_type: r.record_type, track_count: r.nb_tracks }) !== "other"}
|
||||
{CAT_ONE[fileRelease({ title: r.title, record_type: r.record_type, track_count: r.nb_tracks })]}
|
||||
{/if}
|
||||
</div>
|
||||
<div class="sub">{cat === "other" ? "" : CAT_ONE[cat]}</div>
|
||||
</div>
|
||||
{/snippet}
|
||||
|
||||
|
||||
Reference in new issue
Block a user