summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2023-08-29 02:45:54 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2023-08-29 02:48:51 -0400
commite60ade1fbcb0f1c5a5cd15217b32565c80b166a7 (patch)
treea59e348a507f573d10b24f49b83f2db518cf80b7
parent1c80f5358110edd5777aeed15080249050ec2378 (diff)
downloadrockbox-e60ade1fbc.tar.gz
rockbox-e60ade1fbc.zip
[BugFix] last fm scrobbler not saving pending tracks on shutdown
Change-Id: If7b03220c466ccf3f27cdf13d2e0b50d6a312bdc
-rw-r--r--apps/menus/playback_menu.c1
-rw-r--r--apps/plugins/lastfm_scrobbler.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/apps/menus/playback_menu.c b/apps/menus/playback_menu.c
index a0732d3feb..61205b1a08 100644
--- a/apps/menus/playback_menu.c
+++ b/apps/menus/playback_menu.c
@@ -261,6 +261,7 @@ static int playback_callback(int action,
break;
}
return action;
+ (void)this_item;
}
/* PLAYBACK MENU */
/***********************************/
diff --git a/apps/plugins/lastfm_scrobbler.c b/apps/plugins/lastfm_scrobbler.c
index fa3ab08fe0..ca6f9aa8f5 100644
--- a/apps/plugins/lastfm_scrobbler.c
+++ b/apps/plugins/lastfm_scrobbler.c
@@ -575,6 +575,7 @@ static int create_log_entry(const struct mp3entry *id,
static void scrobbler_add_to_cache(const struct mp3entry *id)
{
+ logf("%s", __func__);
int trk_info_len = 0;
if (id->elapsed < (unsigned long) gConfig.minms)
@@ -663,6 +664,7 @@ static void scrobbler_flush_cache(void)
/* Add any pending entries to the cache */
if (gCache.pending)
{
+ logf("SCROBBLER: pending entry");
gCache.pending = false;
if (rb->audio_status())
scrobbler_add_to_cache(rb->audio_current_track());
@@ -762,20 +764,23 @@ void thread(void)
in_usb = false;
/*fall through*/
case EV_STARTUP:
+ logf("SCROBBLER: Thread Started");
events_register();
play_tone(1500, 100);
break;
case SYS_POWEROFF:
+ logf("SYS_POWEROFF");
+ /*fall through*/
case SYS_REBOOT:
gCache.force_flush = true;
/*fall through*/
case EV_EXIT:
#if USING_STORAGE_CALLBACK
rb->unregister_storage_idle_func(scrobbler_flush_callback, false);
-#else
+#endif
if (!in_usb)
scrobbler_flush_cache();
-#endif
+
events_unregister();
return;
case EV_FLUSHCACHE: