Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send the correct playing_now listen metadata #2859

Merged
merged 1 commit into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions frontend/js/src/common/brainzplayer/BrainzPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -623,16 +623,22 @@ export default class BrainzPlayer extends React.Component<
album?: string,
artwork?: Array<MediaImage>
): void => {
const { playerPaused } = this.state;
this.setState(
{
currentTrackName: title,
currentTrackArtist: artist,
currentTrackURL: trackURL,
currentTrackAlbum: album,
},
this.updateWindowTitle
() => {
this.updateWindowTitle();
if (!playerPaused) {
this.submitNowPlayingToListenBrainz();
}
}
);
const { playerPaused } = this.state;

if (playerPaused) {
// Don't send notifications or any of that if the player is not playing
// (Avoids getting notifications upon pausing a track)
Expand Down Expand Up @@ -670,8 +676,6 @@ export default class BrainzPlayer extends React.Component<
this.handleInfoMessage(message, `Playing a track`);
}
});

this.submitNowPlayingToListenBrainz();
};

// eslint-disable-next-line react/sort-comp
Expand Down