Add Transform.new/1

This commit is contained in:
Claudio Ortolina
2025-09-19 23:58:09 +03:00
parent 2e8399c44b
commit c5d856fdd8
4 changed files with 6 additions and 4 deletions
@@ -21,8 +21,8 @@ defmodule MusicLibraryWeb.CollectionJSON do
id: record.id,
artists: Enum.map(record.artists, & &1.name),
title: record.title,
cover_url: url(~p"/api/assets/#{%Transform{hash: record.cover_hash}}"),
thumb_url: url(~p"/api/assets/#{%Transform{hash: record.cover_hash, width: 480}}")
cover_url: url(~p"/api/assets/#{Transform.new(hash: record.cover_hash)}"),
thumb_url: url(~p"/api/assets/#{Transform.new(hash: record.cover_hash, width: 480)}")
}
end
end