Skip to content

Commit 4148d7e

Browse files
committed
fix(books): render format badges as fmt.name, not [object Object]
The format badges over each book card were rendering the object stringification of a CalibreFormat ({name, downloadUrl}), which the type cast to `string[]` papered over. One-character swap to the real field name.
1 parent 0f4839f commit 4148d7e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/routes/books/+page.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@
409409
<MediaCard item={entry.item} />
410410
{#if entry.item.metadata?.formats}
411411
<div class="absolute bottom-[3.2rem] left-1 z-10 flex gap-0.5">
412-
{#each (entry.item.metadata.formats as string[]).slice(0, 3) as fmt (fmt)}
413-
<span class="rounded bg-black/60 px-1 py-0.5 text-[9px] font-medium uppercase text-white/80 backdrop-blur-sm">{fmt}</span>
412+
{#each (entry.item.metadata.formats as { name: string }[]).slice(0, 3) as fmt (fmt.name)}
413+
<span class="rounded bg-black/60 px-1 py-0.5 text-[9px] font-medium uppercase text-white/80 backdrop-blur-sm">{fmt.name}</span>
414414
{/each}
415415
</div>
416416
{/if}
@@ -433,8 +433,8 @@
433433
<MediaCard item={entry.item} />
434434
{#if entry.item.metadata?.formats}
435435
<div class="absolute bottom-[3.2rem] left-1 z-10 flex gap-0.5">
436-
{#each (entry.item.metadata.formats as string[]).slice(0, 3) as fmt (fmt)}
437-
<span class="rounded bg-black/60 px-1 py-0.5 text-[9px] font-medium uppercase text-white/80 backdrop-blur-sm">{fmt}</span>
436+
{#each (entry.item.metadata.formats as { name: string }[]).slice(0, 3) as fmt (fmt.name)}
437+
<span class="rounded bg-black/60 px-1 py-0.5 text-[9px] font-medium uppercase text-white/80 backdrop-blur-sm">{fmt.name}</span>
438438
{/each}
439439
</div>
440440
{/if}

0 commit comments

Comments
 (0)