Restore refreshing covers synchronously (better UX)

This commit is contained in:
Claudio Ortolina
2025-04-14 17:41:11 +01:00
parent 7c0cee4732
commit a3be37e86e
2 changed files with 7 additions and 8 deletions
@@ -83,11 +83,14 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
end
def handle_event("refresh_cover", %{"id" => id}, socket) do
case Records.refresh_cover_async(id) do
{:ok, _worker} ->
record = Records.get_record!(id)
case Records.refresh_cover(record) do
{:ok, record} ->
{:noreply,
socket
|> put_flash(:info, gettext("Cover scheduled for refresh"))}
|> assign(:record, record)
|> put_flash(:info, gettext("Cover refreshed successfully"))}
{:error, reason} ->
{:noreply,
+1 -5
View File
@@ -344,6 +344,7 @@ msgstr ""
msgid "Refresh LastFm Feed"
msgstr ""
#: lib/music_library_web/live/collection_live/show.ex
#: lib/music_library_web/live/wishlist_live/show.ex
#, elixir-autogen, elixir-format
msgid "Cover refreshed successfully"
@@ -732,11 +733,6 @@ msgstr ""
msgid "Meta"
msgstr ""
#: lib/music_library_web/live/collection_live/show.ex
#, elixir-autogen, elixir-format
msgid "Cover scheduled for refresh"
msgstr ""
#: lib/music_library_web/live/collection_live/show.ex
#, elixir-autogen, elixir-format
msgid "Record updated in the background"