Return more record information in the API

This commit is contained in:
Claudio Ortolina
2025-10-25 11:52:50 +01:00
parent 886f4815c8
commit 59eb603b3f
2 changed files with 28 additions and 40 deletions
@@ -25,6 +25,12 @@ defmodule MusicLibraryWeb.CollectionJSON do
defp record(record) do
%{
id: record.id,
type: record.type,
format: record.format,
musicbrainz_id: record.musicbrainz_id,
genres: record.genres,
release_date: record.release_date,
purchased_at: record.purchased_at,
artists: Enum.map(record.artists, & &1.name),
title: record.title,
cover_url: url(~p"/api/assets/#{Transform.new(hash: record.cover_hash)}"),