summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/plugins/lastfm_scrobbler.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/plugins/lastfm_scrobbler.c b/apps/plugins/lastfm_scrobbler.c
index ca6f9aa8f5..2c0597656c 100644
--- a/apps/plugins/lastfm_scrobbler.c
+++ b/apps/plugins/lastfm_scrobbler.c
@@ -136,6 +136,7 @@ void play_tone(unsigned int frequency, unsigned int duration);
136static struct 136static struct
137{ 137{
138 bool exiting; /* signal to the thread that we want to exit */ 138 bool exiting; /* signal to the thread that we want to exit */
139 bool hide_reentry; /* we may return on WPS fail, hide next invocation */
139 unsigned int id; /* worker thread id */ 140 unsigned int id; /* worker thread id */
140 struct event_queue queue; /* thread event queue */ 141 struct event_queue queue; /* thread event queue */
141 struct queue_sender_list queue_send; 142 struct queue_sender_list queue_send;
@@ -841,6 +842,13 @@ static int plugin_exit_tsr(bool reenter)
841 "Quit scrobbler?" }, 3 842 "Quit scrobbler?" }, 3
842 }; 843 };
843 844
845 if (gThread.hide_reentry &&
846 (rb->audio_status() & (AUDIO_STATUS_PLAY | AUDIO_STATUS_PAUSE)) == 0)
847 {
848 gThread.hide_reentry = false;
849 return PLUGIN_TSR_CONTINUE;
850 }
851
844 while(true) 852 while(true)
845 { 853 {
846 int result = reenter ? rb->do_menu(&menu, NULL, NULL, false) : 2; 854 int result = reenter ? rb->do_menu(&menu, NULL, NULL, false) : 2;
@@ -897,8 +905,10 @@ static int plugin_main(const void* parameter)
897 rb->memcpy(&gConfig, &cfg, sizeof(struct scrobbler_cfg)); /*restore settings */ 905 rb->memcpy(&gConfig, &cfg, sizeof(struct scrobbler_cfg)); /*restore settings */
898 906
899 if (gConfig.playback) 907 if (gConfig.playback)
908 {
909 gThread.hide_reentry = true;
900 return PLUGIN_GOTO_WPS; 910 return PLUGIN_GOTO_WPS;
901 911 }
902 return PLUGIN_OK; 912 return PLUGIN_OK;
903} 913}
904 914