Skip to content

Commit 6426b6a

Browse files
Fix issue with ads causing a fatal error.
1 parent 6728cdf commit 6426b6a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/SpotifyPlayer.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,19 @@ void SpotifyPlayer::refreshCurrentSong(CurrentlyPlaying currentlyPlaying)
561561
// const char* artist =
562562
spLogI(LOGTAG_MULTITASK, "Refreshing current song. SpotifyPlayer::refreshCurrentSong(CurrentlyPlaying currentlyPlaying)");
563563

564+
// If not a track or episode, update the UI accordingly and indicate music isn't available
565+
if ((!currentlyPlaying.currentlyPlayingType == SpotifyPlayingType::track)
566+
&& (!currentlyPlaying.currentlyPlayingType == SpotifyPlayingType::episode))
567+
{
568+
spLogI(LOGTAG_GENERAL, " _isMusicAvailable set to false. currentlyPlayingType is not a supported type." );
569+
_isMusicAvailable = false;
570+
// force a refresh to get the waiting message
571+
postScuiMessage(SCUIMessageType::UM_MARK_DIRTY,
572+
"",
573+
true);
574+
return;
575+
}
576+
564577
if (xSemaphoreTake(_xSemaphoreDataCopy, portMAX_DELAY))
565578
{
566579
// copy currentlyPlaying over for use

0 commit comments

Comments
 (0)