From e0ac8d1923a6687b2943e0c61d7d1e92fc36e64a Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sun, 17 Nov 2024 21:55:43 +0000 Subject: [PATCH] Add button to refresh Scrobble activity --- .../live/stats_live/index.ex | 5 ++++ .../live/stats_live/index.html.heex | 25 ++++++++++++++++--- priv/gettext/default.pot | 13 +++++++--- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/lib/music_library_web/live/stats_live/index.ex b/lib/music_library_web/live/stats_live/index.ex index dc5f3fc8..90a72cb2 100644 --- a/lib/music_library_web/live/stats_live/index.ex +++ b/lib/music_library_web/live/stats_live/index.ex @@ -77,6 +77,11 @@ defmodule MusicLibraryWeb.StatsLive.Index do end end + def handle_event("refresh_lastfm_feed", _, socket) do + LastFm.Refresh.refresh() + {:noreply, socket} + end + def handle_info(%{tracks: recent_tracks}, socket) do release_ids = recent_tracks diff --git a/lib/music_library_web/live/stats_live/index.html.heex b/lib/music_library_web/live/stats_live/index.html.heex index baaa89d1..806f3d36 100644 --- a/lib/music_library_web/live/stats_live/index.html.heex +++ b/lib/music_library_web/live/stats_live/index.html.heex @@ -62,9 +62,28 @@
-

- <%= gettext("Scrobble activity") %> -

+
+

+ <%= gettext("Scrobble activity") %> +

+ +