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 059724ab..47d06191 100644 --- a/lib/music_library_web/live/scrobble_live/show.html.heex +++ b/lib/music_library_web/live/scrobble_live/show.html.heex @@ -1,245 +1,231 @@
- <%= if @loading do %> -
- <.icon name="hero-arrow-path" class="h-8 w-8 animate-spin mx-auto text-gray-400" /> -

Loading release details...

-
- <% else %> -
-
- <.link navigate={~p"/scrobble"} class="flex-shrink-0"> - <.button variant="ghost" size="sm"> - <.icon name="hero-arrow-left" class="h-4 w-4 mr-2" /> Back to Search - - +
+ <.icon name="hero-arrow-path" class="h-8 w-8 animate-spin mx-auto text-gray-400" /> +

{gettext("Loading release details...")}

+
+
+
+ <.link navigate={~p"/scrobble"} class="flex-shrink-0"> + <.button variant="ghost" size="sm"> + <.icon name="hero-arrow-left" class="h-4 w-4 mr-2" /> {gettext("Back to Search")} + + -
-

- {@release.title} -

-

- <%= if @release.artists != [] do %> - by {@release.artists |> Enum.map(& &1.name) |> Enum.join(", ")} - <% end %> - <%= if @release.date do %> - {@release.date} - <% end %> +

+

+ {@release.title} +

+

+ + by {@release.artists |> Enum.map(& &1.name) |> Enum.join(", ")} + + + {@release.date} + +

+
+
+ +
+
+ <.icon name="hero-exclamation-triangle" class="h-5 w-5 text-yellow-400" /> +
+

+ {gettext( + "You need to connect your Last.fm account to scrobble. Please set up your Last.fm session key in the settings." + )}

+
- <%= if not @can_scrobble do %> -
-
- <.icon name="hero-exclamation-triangle" class="h-5 w-5 text-yellow-400" /> -
-

- You need to connect your Last.fm account to scrobble. Please set up your Last.fm session key in the settings. -

-
-
-
- <% end %> - -
-
-
-
-

Release Information

-
-
- {"Cover -
-
-
- <%= if @release.date do %> -
- - Release Date: - -
{@release.date} -
- <% end %> - <%= if @release.country do %> -
- - Country: - -
{@release.country} -
- <% end %> - <%= if @release.barcode do %> -
- - Barcode: - -
{@release.barcode} -
- <% end %> - <%= if @release.catalog_number do %> -
- - Catalog Number: - -
{@release.catalog_number} -
- <% end %> +
+
+
+
+

{gettext("Release Information")}

+
+
+ {"Cover +
+
+
+
+ + {gettext("Release Date:")} + +
{@release.date} +
+
+ + {gettext("Country:")} + +
{@release.country} +
+
+ + {gettext("Barcode:")} + +
{@release.barcode} +
+
+ + {gettext("Catalog Number:")} + +
{@release.catalog_number}
- - <%= if @release.media != [] do %> -
-
-

Tracks

-
- <%= for medium <- @release.media do %> -
-
-

- <%= if length(@release.media) > 1 do %> - Medium {medium.number} - <%= if medium.title do %> - - {medium.title} - <% end %> - <%= if medium.format do %> - ({medium.format}) - <% end %> - <% else %> - Tracks - <%= if medium.format do %> - ({medium.format}) - <% end %> - <% end %> -

- <%= if @can_scrobble do %> - <.button - size="sm" - variant="outline" - phx-click="scrobble_medium" - phx-value-medium_number={medium.number} - > - <.icon name="hero-play" class="h-3 w-3 mr-1" /> Scrobble Medium - - <% end %> -
- -
- <%= for track <- medium.tracks do %> -
-
- - {track.position} - -
-

- {track.title} -

- <%= if track.artists != [] and track.artists != @release.artists do %> -

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

- <% end %> -
-
- <%= if track.length do %> - - {format_duration(track.length)} - - <% end %> -
- <% end %> -
-
- <% end %> -
-
-
- <% end %>
- <%= if @can_scrobble do %> -
-
-
-

Scrobble Options

- - <.form - for={%{}} - as={:scrobble} - phx-change="update_scrobble_form" - class="space-y-4" - > - <.select - name="type" - label="Scrobble timing" - value={@scrobble_form["type"]} - options={[ - {"Just finished listening", "finished_at"}, - {"Started listening at", "started_at"} - ]} - /> - - <%= if @scrobble_form["type"] == "finished_at" do %> -
- <.input - type="date" - name="finished_at_date" - label="Finished Date" - value={@scrobble_form["finished_at_date"]} - /> - <.input - type="time" - name="finished_at_time" - label="Finished Time" - value={@scrobble_form["finished_at_time"]} - /> -
- <% else %> -
- <.input - type="date" - name="started_at_date" - label="Started Date" - value={@scrobble_form["started_at_date"]} - /> - <.input - type="time" - name="started_at_time" - label="Started Time" - value={@scrobble_form["started_at_time"]} - /> -
- <% end %> - - -
+
+
+

{gettext("Tracks")}

+
+
+
+

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

+

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

<.button - phx-click="scrobble_release" - class="w-full" - size="lg" + :if={@can_scrobble} + size="sm" + variant="outline" + phx-click="scrobble_medium" + phx-value-medium_number={medium.number} > - <.icon name="hero-play" class="h-4 w-4 mr-2" /> Scrobble Entire Release + <.icon name="hero-play" class="h-3 w-3 mr-1" /> {gettext("Scrobble Medium")} +
-

- This will scrobble all tracks from all media in sequence -

+
+
+
+ + {track.position} + +
+

+ {track.title} +

+

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

+
+
+ + {format_duration(track.length)} + +
- <% end %> +
+
+ +
+
+
+

{gettext("Scrobble Options")}

+ + <.form + for={%{}} + as={:scrobble} + phx-change="update_scrobble_form" + class="space-y-4" + > + <.select + name="type" + label={gettext("Scrobble timing")} + value={@scrobble_form["type"]} + options={[ + {gettext("Just finished listening"), "finished_at"}, + {gettext("Started listening at"), "started_at"} + ]} + /> + +
+ <.input + type="date" + name="finished_at_date" + label={gettext("Finished Date")} + value={@scrobble_form["finished_at_date"]} + /> + <.input + type="time" + name="finished_at_time" + label={gettext("Finished Time")} + value={@scrobble_form["finished_at_time"]} + /> +
+
+ <.input + type="date" + name="started_at_date" + label={gettext("Started Date")} + value={@scrobble_form["started_at_date"]} + /> + <.input + type="time" + name="started_at_time" + label={gettext("Started Time")} + value={@scrobble_form["started_at_time"]} + /> +
+ + +
+ <.button + phx-click="scrobble_release" + class="w-full" + size="lg" + > + <.icon name="hero-play" class="h-4 w-4 mr-2" /> {gettext( + "Scrobble Entire Release" + )} + + +

+ {gettext("This will scrobble all tracks from all media in sequence")} +

+
+
+
- <% end %> +
diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 43ed4608..074ff545 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -630,6 +630,7 @@ msgid "Albums" msgstr "" #: lib/music_library_web/components/release.ex +#: lib/music_library_web/live/scrobble_live/show.html.heex #: lib/music_library_web/live/stats_live/index.html.heex #, elixir-autogen, elixir-format msgid "Tracks" @@ -1433,3 +1434,98 @@ msgstr[1] "" #, elixir-autogen, elixir-format msgid "Releases for \"%{title}\"" msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Back to Search" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Barcode:" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Catalog Number:" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Country:" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Finished Date" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Finished Time" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Just finished listening" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Loading release details..." +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Release Date:" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Release Information" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Scrobble Entire Release" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Scrobble Medium" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Scrobble Options" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Scrobble timing" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Started Date" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Started Time" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Started listening at" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "This will scrobble all tracks from all media in sequence" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "You need to connect your Last.fm account to scrobble. Please set up your Last.fm session key in the settings." +msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index b894bd43..bbb00447 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -630,6 +630,7 @@ msgid "Albums" msgstr "" #: lib/music_library_web/components/release.ex +#: lib/music_library_web/live/scrobble_live/show.html.heex #: lib/music_library_web/live/stats_live/index.html.heex #, elixir-autogen, elixir-format msgid "Tracks" @@ -1433,3 +1434,98 @@ msgstr[1] "" #, elixir-autogen, elixir-format msgid "Releases for \"%{title}\"" msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Back to Search" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Barcode:" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Catalog Number:" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Country:" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Finished Date" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Finished Time" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Just finished listening" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format, fuzzy +msgid "Loading release details..." +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format, fuzzy +msgid "Release Date:" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Release Information" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format, fuzzy +msgid "Scrobble Entire Release" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format, fuzzy +msgid "Scrobble Medium" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format, fuzzy +msgid "Scrobble Options" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format, fuzzy +msgid "Scrobble timing" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Started Date" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Started Time" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "Started listening at" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "This will scrobble all tracks from all media in sequence" +msgstr "" + +#: lib/music_library_web/live/scrobble_live/show.html.heex +#, elixir-autogen, elixir-format +msgid "You need to connect your Last.fm account to scrobble. Please set up your Last.fm session key in the settings." +msgstr ""