diff --git a/lib/music_library_web/live/scrobble_live/show.ex b/lib/music_library_web/live/scrobble_live/show.ex index b325c972..12940e56 100644 --- a/lib/music_library_web/live/scrobble_live/show.ex +++ b/lib/music_library_web/live/scrobble_live/show.ex @@ -1,8 +1,9 @@ defmodule MusicLibraryWeb.ScrobbleLive.Show do use MusicLibraryWeb, :live_view + import(MusicLibraryWeb.Components.Release, only: [medium: 1]) + alias MusicLibrary.ScrobbleActivity - alias MusicLibraryWeb.Duration @impl true def mount(_params, _session, socket) do diff --git a/lib/music_library_web/live/scrobble_live/show.html.heex b/lib/music_library_web/live/scrobble_live/show.html.heex index 8251d09d..d9dc5d24 100644 --- a/lib/music_library_web/live/scrobble_live/show.html.heex +++ b/lib/music_library_web/live/scrobble_live/show.html.heex @@ -75,81 +75,28 @@ -
-
-
-

{gettext("Tracks")}

+
+
+

{gettext("Tracks")}

- <.button - :if={@can_scrobble} - phx-click="scrobble_release" - size="sm" - > - {gettext("Scrobble release")} - -
- -
-
-
-

1} class="font-medium"> - Medium {medium.number} - - - {medium.title} - - - ({medium.format}) - -

-

- {gettext("Tracks")} - - ({medium.format}) - -

- <.button - :if={@can_scrobble} - size="sm" - variant="outline" - phx-click="scrobble_medium" - phx-value-medium_number={medium.number} - > - {gettext("Scrobble disc")} - -
- -
-
-
- - {track.position} - -
-

- {track.title} -

-

- {track.artists |> Enum.map(& &1.name) |> Enum.join(", ")} -

-
-
- - {Duration.format_duration(track.length)} - -
-
-
-
+ <.button + :if={@can_scrobble} + phx-click="scrobble_release" + size="sm" + > + {gettext("Scrobble release")} +
+ + <.medium + :for={medium <- @release.media} + can_scrobble?={@can_scrobble} + already_scrobbled={false} + medium={medium} + release_artists={@release.artists} + media_count={MusicBrainz.Release.media_count(@release)} + myself={nil} + />
diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 78ced8bd..6b55e51d 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -780,7 +780,6 @@ msgid "Error scrobbling disc" msgstr "" #: lib/music_library_web/components/release.ex -#: lib/music_library_web/live/scrobble_live/show.html.heex #, elixir-autogen, elixir-format msgid "Scrobble disc" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index d428018b..7e740638 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -780,7 +780,6 @@ msgid "Error scrobbling disc" msgstr "" #: lib/music_library_web/components/release.ex -#: lib/music_library_web/live/scrobble_live/show.html.heex #, elixir-autogen, elixir-format, fuzzy msgid "Scrobble disc" msgstr ""