Skip to content

Commit

Permalink
Merge pull request #2859 from metabrainz/brainzplayer-metadata
Browse files Browse the repository at this point in the history
Send the correct playing_now listen metadata
  • Loading branch information
MonkeyDo committed May 2, 2024
2 parents d3e2dbb + c8e3a98 commit b08fbc5
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit b08fbc5

Please sign in to comment.