Skip to content

Commit

Permalink
fixed song in wrong slot when pressing enter on current song
Browse files Browse the repository at this point in the history
  • Loading branch information
ravachol committed Sep 3, 2024
1 parent 21adb3a commit 0f2aaee
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/kew.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,15 +385,12 @@ void notifySongSwitch(SongData *currentSongData)

void determineSongAndNotify()
{
if (lastNotifiedId != currentSong->id)
{
SongData *currentSongData = NULL;
SongData *currentSongData = NULL;

bool isDeleted = determineCurrentSongData(&currentSongData);
bool isDeleted = determineCurrentSongData(&currentSongData);

if (!isDeleted)
notifySongSwitch(currentSongData);
}
if (!isDeleted)
notifySongSwitch(currentSongData);
}

// Checks conditions for refreshing player
Expand Down Expand Up @@ -522,7 +519,7 @@ void handleGoToSong()
else
{
if (digitsPressedCount == 0)
{
{
if (isPaused() && currentSong != NULL && chosenNodeId == currentSong->id)
{
togglePause(&totalPauseSeconds, &pauseSeconds, &pause_time);
Expand All @@ -545,8 +542,8 @@ void handleGoToSong()

if (songWasRemoved && currentSong != NULL)
{
usingSongDataA = !usingSongDataA;
songWasRemoved = false;
usingSongDataA = !usingSongDataA;
songWasRemoved = false;
}

audioData.endOfListReached = false;
Expand Down Expand Up @@ -811,7 +808,7 @@ void loadAudioData()
}
else if (currentSong != NULL && (nextSongNeedsRebuilding || nextSong == NULL) && !songLoading)
{
loadNextSong();
loadNextSong();
determineSongAndNotify();
}

Expand Down

0 comments on commit 0f2aaee

Please sign in to comment.