diff --git a/lib/music_brainz/artist.ex b/lib/music_brainz/artist.ex index d6279dd5..95bab574 100644 --- a/lib/music_brainz/artist.ex +++ b/lib/music_brainz/artist.ex @@ -19,6 +19,10 @@ defmodule MusicBrainz.Artist do end) end + def url(id) do + "https://musicbrainz.org/artist/#{id}" + end + defp parse_relations(relations) do Enum.map(relations, fn relation -> %{ diff --git a/lib/music_library_web/live/artist_live/show.html.heex b/lib/music_library_web/live/artist_live/show.html.heex index 629db3e9..f4d7c4de 100644 --- a/lib/music_library_web/live/artist_live/show.html.heex +++ b/lib/music_library_web/live/artist_live/show.html.heex @@ -50,8 +50,8 @@ -
-
+
+

{gettext("Meta")}

@@ -61,6 +61,30 @@ alt={@artist.name} onerror={"this.src = '" <> ~p"/images/cover-not-found.png" <> "';"} /> +
+
+ {gettext("MusicBrainz ID")} +
+
+ + + {@artist.musicbrainz_id} + + + +
+
<.async_result :let={lastfm_artist_info} assign={@lastfm_artist_info}> <:loading>
@@ -122,7 +146,7 @@
-
+
<.record_grid :if={@collection_records_count > 0} title={gettext("Collection")} diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 8bcee7cf..6fa78f9e 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -106,6 +106,7 @@ msgid "Logout" msgstr "" #: lib/music_library_web/components/form_component.ex +#: lib/music_library_web/live/artist_live/show.html.heex #: lib/music_library_web/live/collection_live/show.html.heex #: lib/music_library_web/live/wishlist_live/show.html.heex #, elixir-autogen, elixir-format @@ -262,6 +263,7 @@ msgstr "" msgid "close" msgstr "" +#: lib/music_library_web/live/artist_live/show.html.heex #: lib/music_library_web/live/collection_live/show.html.heex #: lib/music_library_web/live/wishlist_live/show.html.heex #, elixir-autogen, elixir-format diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index ea2664ea..bba99cf8 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -106,6 +106,7 @@ msgid "Logout" msgstr "" #: lib/music_library_web/components/form_component.ex +#: lib/music_library_web/live/artist_live/show.html.heex #: lib/music_library_web/live/collection_live/show.html.heex #: lib/music_library_web/live/wishlist_live/show.html.heex #, elixir-autogen, elixir-format @@ -262,6 +263,7 @@ msgstr "" msgid "close" msgstr "" +#: lib/music_library_web/live/artist_live/show.html.heex #: lib/music_library_web/live/collection_live/show.html.heex #: lib/music_library_web/live/wishlist_live/show.html.heex #, elixir-autogen, elixir-format diff --git a/test/music_library_web/live/artist_live/show_test.exs b/test/music_library_web/live/artist_live/show_test.exs index 6433c8e2..37807cc8 100644 --- a/test/music_library_web/live/artist_live/show_test.exs +++ b/test/music_library_web/live/artist_live/show_test.exs @@ -70,7 +70,7 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do |> assert_has("div", text: "Error loading biography") end - test "it shows the artist country", %{ + test "it shows the artist country and MB id", %{ conn: conn, artist_musicbrainz_id: artist_musicbrainz_id } do @@ -89,6 +89,7 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do |> unwrap(&render_async/1) |> assert_has("span", text: "United Kingdom") |> assert_has("span", text: "🇬🇧") + |> assert_has("dd", text: artist_musicbrainz_id) end test "it shows records from the collection and the wishlist", %{