From 0a9fafd35ed1fa6a3d46dec0f12629b3f0ac7b99 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Tue, 5 May 2026 21:00:28 +0100 Subject: [PATCH] Add micro_cover_url --- lib/music_library_web/controllers/collection_json.ex | 4 +++- .../controllers/collection_controller_test.exs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/music_library_web/controllers/collection_json.ex b/lib/music_library_web/controllers/collection_json.ex index 8a5f1e9f..65b46813 100644 --- a/lib/music_library_web/controllers/collection_json.ex +++ b/lib/music_library_web/controllers/collection_json.ex @@ -36,7 +36,9 @@ defmodule MusicLibraryWeb.CollectionJSON do cover_url: url(~p"/api/v1/assets/#{Transform.new(hash: record.cover_hash)}"), thumb_url: url(~p"/api/v1/assets/#{Transform.new(hash: record.cover_hash, width: 480)}"), mini_cover_url: - url(~p"/api/v1/assets/#{Transform.new(hash: record.cover_hash, width: 150)}") + url(~p"/api/v1/assets/#{Transform.new(hash: record.cover_hash, width: 150)}"), + micro_cover_url: + url(~p"/api/v1/assets/#{Transform.new(hash: record.cover_hash, width: 40)}") } end end diff --git a/test/music_library_web/controllers/collection_controller_test.exs b/test/music_library_web/controllers/collection_controller_test.exs index 4026c0ad..b3d2e11c 100644 --- a/test/music_library_web/controllers/collection_controller_test.exs +++ b/test/music_library_web/controllers/collection_controller_test.exs @@ -102,7 +102,9 @@ defmodule MusicLibraryWeb.CollectionControllerTest do "thumb_url" => "http://localhost:4002/api/v1/assets/eyJoYXNoIjoiNTk5NDA3RERGNjk5MDdENEE2MEZFMTNDQ0FBODI0RDI1Q0YwOERDMTI0RkQ2QUEzRThFN0VDRDk4Qzg4NUZGRSIsIndpZHRoIjo0ODB9", "mini_cover_url" => - "http://localhost:4002/api/v1/assets/eyJoYXNoIjoiNTk5NDA3RERGNjk5MDdENEE2MEZFMTNDQ0FBODI0RDI1Q0YwOERDMTI0RkQ2QUEzRThFN0VDRDk4Qzg4NUZGRSIsIndpZHRoIjoxNTB9" + "http://localhost:4002/api/v1/assets/eyJoYXNoIjoiNTk5NDA3RERGNjk5MDdENEE2MEZFMTNDQ0FBODI0RDI1Q0YwOERDMTI0RkQ2QUEzRThFN0VDRDk4Qzg4NUZGRSIsIndpZHRoIjoxNTB9", + "micro_cover_url" => + "http://localhost:4002/api/v1/assets/eyJoYXNoIjoiNTk5NDA3RERGNjk5MDdENEE2MEZFMTNDQ0FBODI0RDI1Q0YwOERDMTI0RkQ2QUEzRThFN0VDRDk4Qzg4NUZGRSIsIndpZHRoIjo0MH0" } end end