Restore refreshing covers synchronously (better UX)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user