diff options
author | William Wilgus <wilgus.william@gmail.com> | 2023-08-29 02:45:54 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2023-08-29 02:48:51 -0400 |
commit | e60ade1fbcb0f1c5a5cd15217b32565c80b166a7 (patch) | |
tree | a59e348a507f573d10b24f49b83f2db518cf80b7 | |
parent | 1c80f5358110edd5777aeed15080249050ec2378 (diff) | |
download | rockbox-e60ade1fbcb0f1c5a5cd15217b32565c80b166a7.tar.gz rockbox-e60ade1fbcb0f1c5a5cd15217b32565c80b166a7.zip |
[BugFix] last fm scrobbler not saving pending tracks on shutdown
Change-Id: If7b03220c466ccf3f27cdf13d2e0b50d6a312bdc
-rw-r--r-- | apps/menus/playback_menu.c | 1 | ||||
-rw-r--r-- | apps/plugins/lastfm_scrobbler.c | 9 |
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, | |||
261 | break; | 261 | break; |
262 | } | 262 | } |
263 | return action; | 263 | return action; |
264 | (void)this_item; | ||
264 | } | 265 | } |
265 | /* PLAYBACK MENU */ | 266 | /* PLAYBACK MENU */ |
266 | /***********************************/ | 267 | /***********************************/ |
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, | |||
575 | 575 | ||
576 | static void scrobbler_add_to_cache(const struct mp3entry *id) | 576 | static void scrobbler_add_to_cache(const struct mp3entry *id) |
577 | { | 577 | { |
578 | logf("%s", __func__); | ||
578 | int trk_info_len = 0; | 579 | int trk_info_len = 0; |
579 | 580 | ||
580 | if (id->elapsed < (unsigned long) gConfig.minms) | 581 | if (id->elapsed < (unsigned long) gConfig.minms) |
@@ -663,6 +664,7 @@ static void scrobbler_flush_cache(void) | |||
663 | /* Add any pending entries to the cache */ | 664 | /* Add any pending entries to the cache */ |
664 | if (gCache.pending) | 665 | if (gCache.pending) |
665 | { | 666 | { |
667 | logf("SCROBBLER: pending entry"); | ||
666 | gCache.pending = false; | 668 | gCache.pending = false; |
667 | if (rb->audio_status()) | 669 | if (rb->audio_status()) |
668 | scrobbler_add_to_cache(rb->audio_current_track()); | 670 | scrobbler_add_to_cache(rb->audio_current_track()); |
@@ -762,20 +764,23 @@ void thread(void) | |||
762 | in_usb = false; | 764 | in_usb = false; |
763 | /*fall through*/ | 765 | /*fall through*/ |
764 | case EV_STARTUP: | 766 | case EV_STARTUP: |
767 | logf("SCROBBLER: Thread Started"); | ||
765 | events_register(); | 768 | events_register(); |
766 | play_tone(1500, 100); | 769 | play_tone(1500, 100); |
767 | break; | 770 | break; |
768 | case SYS_POWEROFF: | 771 | case SYS_POWEROFF: |
772 | logf("SYS_POWEROFF"); | ||
773 | /*fall through*/ | ||
769 | case SYS_REBOOT: | 774 | case SYS_REBOOT: |
770 | gCache.force_flush = true; | 775 | gCache.force_flush = true; |
771 | /*fall through*/ | 776 | /*fall through*/ |
772 | case EV_EXIT: | 777 | case EV_EXIT: |
773 | #if USING_STORAGE_CALLBACK | 778 | #if USING_STORAGE_CALLBACK |
774 | rb->unregister_storage_idle_func(scrobbler_flush_callback, false); | 779 | rb->unregister_storage_idle_func(scrobbler_flush_callback, false); |
775 | #else | 780 | #endif |
776 | if (!in_usb) | 781 | if (!in_usb) |
777 | scrobbler_flush_cache(); | 782 | scrobbler_flush_cache(); |
778 | #endif | 783 | |
779 | events_unregister(); | 784 | events_unregister(); |
780 | return; | 785 | return; |
781 | case EV_FLUSHCACHE: | 786 | case EV_FLUSHCACHE: |