FoxxMD / multi-scrobbler

Scrobble plays from multiple sources to multiple clients
https://foxxmd.github.io/multi-scrobbler
MIT License
299 stars 14 forks source link

Spotify: Error when fetching recently played while in a private session #116

Closed brunohpaiva closed 6 months ago

brunohpaiva commented 6 months ago

Describe the bug An error occurs when trying to fetch Spotify's recently played tracks if the user is in a private session.

To Reproduce

  1. Enable Spotify's Private Session
  2. Start Multi Scrobbler
  3. Authenticate with Spotify Source
  4. See errors while trying to fetch Spotify's recently played

Expected behavior It shouldn't throw an error when the user is in a private session.

Logs If possible reproduce the issue with debug logging ON

2023-12-12T02:37:03+00:00 debug   : [Sources] [Spotify - unnamed] Refreshing recently played
2023-12-12T02:37:04+00:00 error   : [Sources] [Spotify - unnamed] Error occurred while polling
2023-12-12T02:37:04+00:00 error   : [Sources] [Spotify - unnamed] Cannot read properties of undefined (reading 'data')
TypeError: 
    at t.buildTrackString (CWD/build/server.js:12:90579)
    at b.getRecentlyPlayed (CWD/build/server.js:12:49545)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async b.doPolling (CWD/build/server.js:9:14672)
    at async b.startPolling (CWD/build/server.js:9:12562)
    at async b.poll (CWD/build/server.js:9:12202)

Versions (please complete the following information):

brunohpaiva commented 6 months ago

Fixed in #118