Add button to refresh Scrobble activity
This commit is contained in:
@@ -77,6 +77,11 @@ defmodule MusicLibraryWeb.StatsLive.Index do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def handle_event("refresh_lastfm_feed", _, socket) do
|
||||||
|
LastFm.Refresh.refresh()
|
||||||
|
{:noreply, socket}
|
||||||
|
end
|
||||||
|
|
||||||
def handle_info(%{tracks: recent_tracks}, socket) do
|
def handle_info(%{tracks: recent_tracks}, socket) do
|
||||||
release_ids =
|
release_ids =
|
||||||
recent_tracks
|
recent_tracks
|
||||||
|
|||||||
@@ -62,9 +62,28 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flow-root">
|
<div class="flow-root">
|
||||||
<h1 class="mt-5 text-base lg:text-2xl text-zinc-900 dark:text-zinc-200 font-semibold">
|
<div class="mt-5 flex justify-between items-center">
|
||||||
<%= gettext("Scrobble activity") %>
|
<h1 class="text-base lg:text-2xl text-zinc-900 dark:text-zinc-200 font-semibold">
|
||||||
</h1>
|
<%= gettext("Scrobble activity") %>
|
||||||
|
</h1>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="text-zinc-500 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-300"
|
||||||
|
phx-click={
|
||||||
|
JS.transition("animate-spin", to: "#refresh-lastfm-feed", time: 1000)
|
||||||
|
|> JS.push("refresh_lastfm_feed")
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<span class="sr-only"><%= gettext("Refresh LastFm Feed") %></span>
|
||||||
|
<.icon
|
||||||
|
id="refresh-lastfm-feed"
|
||||||
|
name="hero-arrow-path"
|
||||||
|
class="-mt-1 h-5 w-5"
|
||||||
|
aria-hidden="true"
|
||||||
|
data-slot="icon"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<ul
|
<ul
|
||||||
id="scrobble-activity"
|
id="scrobble-activity"
|
||||||
role="list"
|
role="list"
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ msgid "No results"
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/record_live/index.html.heex:121
|
#: lib/music_library_web/live/record_live/index.html.heex:121
|
||||||
#: lib/music_library_web/live/stats_live/index.html.heex:145
|
#: lib/music_library_web/live/stats_live/index.html.heex:164
|
||||||
#: lib/music_library_web/live/wishlist_live/index.html.heex:121
|
#: lib/music_library_web/live/wishlist_live/index.html.heex:121
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Open options"
|
msgid "Open options"
|
||||||
@@ -363,7 +363,7 @@ msgstr ""
|
|||||||
msgid "MusicBrainz data"
|
msgid "MusicBrainz data"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/stats_live/index.html.heex:66
|
#: lib/music_library_web/live/stats_live/index.html.heex:67
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Scrobble activity"
|
msgid "Scrobble activity"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -373,12 +373,12 @@ msgstr ""
|
|||||||
msgid "Choose which format to import"
|
msgid "Choose which format to import"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/stats_live/index.html.heex:114
|
#: lib/music_library_web/live/stats_live/index.html.heex:133
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Collected"
|
msgid "Collected"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: lib/music_library_web/live/stats_live/index.html.heex:127
|
#: lib/music_library_web/live/stats_live/index.html.heex:146
|
||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Wishlisted"
|
msgid "Wishlisted"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@@ -414,3 +414,8 @@ msgstr ""
|
|||||||
#, elixir-autogen, elixir-format
|
#, elixir-autogen, elixir-format
|
||||||
msgid "Refresh MB Data"
|
msgid "Refresh MB Data"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: lib/music_library_web/live/stats_live/index.html.heex:77
|
||||||
|
#, elixir-autogen, elixir-format
|
||||||
|
msgid "Refresh LastFm Feed"
|
||||||
|
msgstr ""
|
||||||
|
|||||||
Reference in New Issue
Block a user