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

Loading…
Cancel
Save