Show included release groups in record show page
This commit is contained in:
@@ -61,6 +61,9 @@ defmodule MusicLibrary.Records.Record do
|
|||||||
relation["type"] == "included in" and
|
relation["type"] == "included in" and
|
||||||
relation["direction"] == "backward"
|
relation["direction"] == "backward"
|
||||||
end)
|
end)
|
||||||
|
|> Enum.map(fn relation ->
|
||||||
|
MusicBrainz.ReleaseGroup.from_api_response(relation["release_group"])
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
def child_release_groups_count(record) do
|
def child_release_groups_count(record) do
|
||||||
|
|||||||
@@ -82,6 +82,21 @@
|
|||||||
<%= human_datetime(@record.purchased_at) %>
|
<%= human_datetime(@record.purchased_at) %>
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
:if={Records.Record.child_release_groups_count(@record) > 0}
|
||||||
|
class="py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0"
|
||||||
|
>
|
||||||
|
<dt class="text-sm font-medium leading-6 text-zinc-900 dark:text-zinc-400">
|
||||||
|
<%= gettext("Includes") %>
|
||||||
|
</dt>
|
||||||
|
<dd class="mt-1 text-sm leading-6 text-zinc-700 dark:text-zinc-300 sm:col-span-2 sm:mt-0">
|
||||||
|
<ul>
|
||||||
|
<li :for={child_release_group <- Records.Record.child_release_groups(@record)}>
|
||||||
|
<%= child_release_group.artists %> - <%= child_release_group.title %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
<div class="py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
<div class="py-2 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
|
||||||
<dt class="text-sm font-medium leading-6 text-zinc-900 dark:text-zinc-400">
|
<dt class="text-sm font-medium leading-6 text-zinc-900 dark:text-zinc-400">
|
||||||
<%= gettext("Inserted at") %>
|
<%= gettext("Inserted at") %>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ msgstr ""
|
|||||||
msgid "Attempting to reconnect"
|
msgid "Attempting to reconnect"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/record_live/show.html.heex:112
|
#: lib/music_library_web/live/record_live/show.html.heex:127
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Back to records"
|
msgid "Back to records"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -128,7 +128,7 @@ msgstr ""
|
|||||||
msgid "Import from MusicBrainz"
|
msgid "Import from MusicBrainz"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/record_live/show.html.heex:87
|
#: lib/music_library_web/live/record_live/show.html.heex:102
|
||||||
#: lib/music_library_web/live/wishlist_live/show.html.heex:80
|
#: lib/music_library_web/live/wishlist_live/show.html.heex:80
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Inserted at"
|
msgid "Inserted at"
|
||||||
@@ -311,7 +311,7 @@ msgstr ""
|
|||||||
msgid "Types"
|
msgid "Types"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/record_live/show.html.heex:95
|
#: lib/music_library_web/live/record_live/show.html.heex:110
|
||||||
#: lib/music_library_web/live/wishlist_live/show.html.heex:88
|
#: lib/music_library_web/live/wishlist_live/show.html.heex:88
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Updated at"
|
msgid "Updated at"
|
||||||
@@ -356,7 +356,7 @@ msgstr ""
|
|||||||
msgid "Copy MusicBrainz ID to clipboard"
|
msgid "Copy MusicBrainz ID to clipboard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/record_live/show.html.heex:106
|
#: lib/music_library_web/live/record_live/show.html.heex:121
|
||||||
#: lib/music_library_web/live/wishlist_live/show.html.heex:99
|
#: lib/music_library_web/live/wishlist_live/show.html.heex:99
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "MusicBrainz data"
|
msgid "MusicBrainz data"
|
||||||
@@ -389,3 +389,8 @@ msgstr ""
|
|||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Number of included records"
|
msgid "Number of included records"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/record_live/show.html.heex:90
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Includes"
|
||||||
|
msgstr ""
|
||||||
|
|||||||
Reference in New Issue
Block a user