Return thumb_url in latest record response
This commit is contained in:
@@ -5,7 +5,8 @@ defmodule MusicLibraryWeb.CollectionJSON do
|
|||||||
%{
|
%{
|
||||||
artists: Enum.map(record.artists, & &1.name),
|
artists: Enum.map(record.artists, & &1.name),
|
||||||
title: record.title,
|
title: record.title,
|
||||||
cover_url: url(~p"/api/covers/#{record.id}?#{[vsn: record.cover_hash]}")
|
cover_url: url(~p"/api/covers/#{record.id}?#{[vsn: record.cover_hash]}"),
|
||||||
|
thumb_url: url(~p"/api/covers/#{record.id}?#{[vsn: record.cover_hash, size: 480]}")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ defmodule MusicLibraryWeb.CollectionControllerTest do
|
|||||||
"artists" => ["Steven Wilson"],
|
"artists" => ["Steven Wilson"],
|
||||||
"title" => record.title,
|
"title" => record.title,
|
||||||
"cover_url" =>
|
"cover_url" =>
|
||||||
"http://localhost:4002/api/covers/#{record.id}?vsn=#{record.cover_hash}"
|
"http://localhost:4002/api/covers/#{record.id}?vsn=#{record.cover_hash}",
|
||||||
|
"thumb_url" =>
|
||||||
|
"http://localhost:4002/api/covers/#{record.id}?vsn=#{record.cover_hash}&size=480"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user