Browse Source

Song from playerNumber instead of current (#364)

master
Kendall Garner 2 years ago
committed by GitHub
parent
commit
50eb7ef1bc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      src/components/player/Player.tsx

20
src/components/player/Player.tsx

@ -615,15 +615,20 @@ const Player = ({ currentEntryList, muted, children }: any, ref: any) => {
const handleOnPlay = useCallback( const handleOnPlay = useCallback(
(playerNumber: 1 | 2) => { (playerNumber: 1 | 2) => {
const currentSong =
playerNumber === 1
? playQueue[currentEntryList][playQueue.player1.index]
: playQueue[currentEntryList][playQueue.player2.index];
ipcRenderer.send('current-song', playQueue.current); ipcRenderer.send('current-song', playQueue.current);
if (config.player.systemNotifications) { if (config.player.systemNotifications && currentSong) {
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Notification(playQueue.current.title, { new Notification(currentSong.title, {
body: `${playQueue.current.artist.map((artist: Artist) => artist.title).join(', ')}\n${ body: `${currentSong.artist.map((artist: Artist) => artist.title).join(', ')}\n${
playQueue.current.album currentSong.album
}`, }`,
icon: playQueue.current.image, icon: currentSong.image,
}); });
} }
@ -637,10 +642,7 @@ const Player = ({ currentEntryList, muted, children }: any, ref: any) => {
serverType: config.serverType, serverType: config.serverType,
endpoint: 'scrobble', endpoint: 'scrobble',
args: { args: {
id: id: currentSong?.id,
playerNumber === 1
? playQueue[currentEntryList][playQueue.player1.index]?.id
: playQueue[currentEntryList][playQueue.player2.index]?.id,
submission: false, submission: false,
position: currentSeek * 1e7, position: currentSeek * 1e7,
event: 'unpause', event: 'unpause',

Loading…
Cancel
Save