Restore refreshing covers synchronously (better UX)
This commit is contained in:
@@ -83,11 +83,14 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def handle_event("refresh_cover", %{"id" => id}, socket) do
|
def handle_event("refresh_cover", %{"id" => id}, socket) do
|
||||||
case Records.refresh_cover_async(id) do
|
record = Records.get_record!(id)
|
||||||
{:ok, _worker} ->
|
|
||||||
|
case Records.refresh_cover(record) do
|
||||||
|
{:ok, record} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
socket
|
socket
|
||||||
|> put_flash(:info, gettext("Cover scheduled for refresh"))}
|
|> assign(:record, record)
|
||||||
|
|> put_flash(:info, gettext("Cover refreshed successfully"))}
|
||||||
|
|
||||||
{:error, reason} ->
|
{:error, reason} ->
|
||||||
{:noreply,
|
{:noreply,
|
||||||
|
|||||||
@@ -344,6 +344,7 @@ msgstr ""
|
|||||||
msgid "Refresh LastFm Feed"
|
msgid "Refresh LastFm Feed"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/collection_live/show.ex
|
||||||
#: lib/music_library_web/live/wishlist_live/show.ex
|
#: lib/music_library_web/live/wishlist_live/show.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Cover refreshed successfully"
|
msgid "Cover refreshed successfully"
|
||||||
@@ -732,11 +733,6 @@ msgstr ""
|
|||||||
msgid "Meta"
|
msgid "Meta"
|
||||||
msgstr ""
|
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
|
#: lib/music_library_web/live/collection_live/show.ex
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Record updated in the background"
|
msgid "Record updated in the background"
|
||||||
|
|||||||
Reference in New Issue
Block a user