Simplify non-linked state using Last.fm connect button

This commit is contained in:
Claudio Ortolina
2025-09-24 10:23:03 +03:00
parent 6a0c4289f6
commit d9abad53d5
4 changed files with 11 additions and 16 deletions
@@ -13,7 +13,7 @@ defmodule MusicLibraryWeb.ScrobbleLive.Index do
selected_release_group: nil,
releases: [],
loading: false,
can_scrobble: ScrobbleActivity.can_scrobble?()
can_scrobble?: ScrobbleActivity.can_scrobble?()
)}
end
@@ -3,22 +3,15 @@
<h1 class="mt-5 text-base lg:text-2xl text-zinc-900 dark:text-zinc-200 font-semibold">
{gettext("Scrobble to Last.fm")}
</h1>
<p class="text-sm text-gray-600 dark:text-gray-400 mt-2">
Search for MusicBrainz releases and scrobble them to Last.fm
</p>
<%= if not @can_scrobble do %>
<div class="bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4 mt-4">
<div class="flex">
<.icon name="hero-exclamation-triangle" class="h-5 w-5 text-yellow-400" />
<div class="ml-3">
<p class="text-sm text-yellow-800 dark:text-yellow-200">
You need to connect your Last.fm account to scrobble. Please set up your Last.fm session key in the settings.
</p>
</div>
</div>
</div>
<% end %>
<div
:if={!@can_scrobble?}
class="bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4 mt-4"
>
<.button :if={!@can_scrobble?} size="sm" href={LastFm.auth_url()}>
{gettext("Connect your Last.fm account")}
</.button>
</div>
<div class="mt-6 space-y-6">
<.form for={%{}} as={:search} phx-submit="search" class="space-y-4">
+1
View File
@@ -748,6 +748,7 @@ msgid "Release scrobbled successfully"
msgstr ""
#: lib/music_library_web/components/release.ex
#: lib/music_library_web/live/scrobble_live/index.html.heex
#, elixir-autogen, elixir-format
msgid "Connect your Last.fm account"
msgstr ""
+1
View File
@@ -748,6 +748,7 @@ msgid "Release scrobbled successfully"
msgstr ""
#: lib/music_library_web/components/release.ex
#: lib/music_library_web/live/scrobble_live/index.html.heex
#, elixir-autogen, elixir-format
msgid "Connect your Last.fm account"
msgstr ""