lastfm_scrobbler fix red for devices w/o storage callback

Change-Id: I2062534b6e2a82171b856cc76efe8b78dbf9b13c
This commit is contained in:
William Wilgus 2022-03-26 03:20:49 -04:00
parent fd15ea25d3
commit f105ad7b23

View file

@ -355,7 +355,9 @@ static void scrobbler_add_to_cache(const struct mp3entry *id)
{ {
logf("Added %s", scrobbler_buf); logf("Added %s", scrobbler_buf);
gCache.pos++; gCache.pos++;
#if USING_STORAGE_CALLBACK
rb->register_storage_idle_func(scrobbler_flush_callback); rb->register_storage_idle_func(scrobbler_flush_callback);
#endif
} }
} }
@ -466,7 +468,12 @@ void thread(void)
gCache.force_flush = true; gCache.force_flush = true;
/*fall through*/ /*fall through*/
case EV_EXIT: case EV_EXIT:
#if USING_STORAGE_CALLBACK
rb->unregister_storage_idle_func(scrobbler_flush_callback, !in_usb); rb->unregister_storage_idle_func(scrobbler_flush_callback, !in_usb);
#else
if (!in_usb)
scrobbler_flush_cache();
#endif
return; return;
case EV_OTHINSTANCE: case EV_OTHINSTANCE:
scrobbler_flush_cache(); scrobbler_flush_cache();