Browse Source

Fix scrobble condition based on setting

master
jeffvli 3 years ago
parent
commit
38dbbc814b
  1. 2
      src/components/player/Player.tsx
  2. 4
      src/hooks/usePlayerControls.ts

2
src/components/player/Player.tsx

@ -619,7 +619,7 @@ const Player = ({ currentEntryList, muted, children }: any, ref: any) => {
(playerNumber: 1 | 2) => { (playerNumber: 1 | 2) => {
ipcRenderer.send('current-song', playQueue.current); ipcRenderer.send('current-song', playQueue.current);
if (config.serverType === Server.Jellyfin) { if (config.serverType === Server.Jellyfin && playQueue.scrobble) {
const currentSeek = const currentSeek =
playerNumber === 1 playerNumber === 1
? player1Ref.current.audioEl.current.currentTime ? player1Ref.current.audioEl.current.currentTime

4
src/hooks/usePlayerControls.ts

@ -70,7 +70,7 @@ const usePlayerControls = (
playersRef.current.player2.audioEl.current.volume = 0; playersRef.current.player2.audioEl.current.volume = 0;
playersRef.current.player2.audioEl.current.pause(); playersRef.current.player2.audioEl.current.pause();
if (config.serverType === Server.Jellyfin) { if (config.serverType === Server.Jellyfin && playQueue.scrobble) {
apiController({ apiController({
serverType: config.serverType, serverType: config.serverType,
endpoint: 'scrobble', endpoint: 'scrobble',
@ -91,7 +91,7 @@ const usePlayerControls = (
playersRef.current.player1.audioEl.current.volume = 0; playersRef.current.player1.audioEl.current.volume = 0;
playersRef.current.player1.audioEl.current.pause(); playersRef.current.player1.audioEl.current.pause();
if (config.serverType === Server.Jellyfin) { if (config.serverType === Server.Jellyfin && playQueue.scrobble) {
apiController({ apiController({
serverType: config.serverType, serverType: config.serverType,
endpoint: 'scrobble', endpoint: 'scrobble',

Loading…
Cancel
Save