NBS-LLC / ng-spotify-importer

Import playlists into Spotify.
https://nickwanders.com/projects/ng-spotify-importer/
GNU General Public License v3.0
108 stars 17 forks source link

Spotify returns 404 for single CSV entry which fails whole import #202

Closed jamescrowley closed 1 year ago

jamescrowley commented 2 years ago

Awesome tool! If I try importing the following CSV:

Title,Artist
Wolfgang Amadeus Mozart - Piano Concerto No 21 in C 'Elvira Madigan' - Andante,Wolfgang Amadeus Mozart

the progress bar shows 100%, but there's no option to import the playlist.

This entry appeared in a much longer playlist but I tracked down the errors to this entry (you can reproduce just with the above). Spotify returns a 404. I'm guessing maybe length or encoding related?

Looking in the Chrome developer console I see the following:

Screenshot 2022-08-15 at 21 11 13
  onFileRead: 871 songs parsed
  api.spotify.com/v1/search/?q=%22Wolfgang%20Amadeus%20Mozart%20-%20Piano%20Concerto%20No%2021%20in%20C%20%27Elvira%20Madigan%27%20-%20Andante%22%20artist%3A%22Wolfgang%20Amadeus%20Mozart%22&type=track&limit=1:1         
         Failed to load resource: the server responded with a status of 404 ()
  main-es2015.644493e96d36e42b4744.js:formatted:11155 

         ERROR Error: Uncaught (in promise): XMLHttpRequest: {"__zone_symbol__xhrSync":false,"__zone_symbol__xhrURL":"https://api.spotify.com/v1/search/?q=%22Wolfgang%20Amadeus%20Mozart%20-%20Piano%20Concerto%20No%2021%20in%20C%20'Elvira%20Madigan'%20-%20Andante%22%20artist%3A%22Wolfgang%20Amadeus%20Mozart%22&type=track&limit=1","__zone_symbol__readystatechangefalse":[{"type":"eventTask","state":"scheduled","source":"XMLHttpRequest.addEventListener:readystatechange","zone":"angular","runCount":6}],"__zone_symbol__xhrScheduled":true,"__zone_symbol__xhrErrorBeforeScheduled":false,"__zone_symbol__xhrTask":{"type":"macroTask","state":"scheduled","source":"XMLHttpRequest.send","zone":"angular","runCount":0}}
      at T (polyfills-es2015.1f03f79e7b3f74395f0f.js:1:12196)
      at T (polyfills-es2015.1f03f79e7b3f74395f0f.js:1:11724)
      at polyfills-es2015.1f03f79e7b3f74395f0f.js:1:13005
      at l.invokeTask (polyfills-es2015.1f03f79e7b3f74395f0f.js:1:7242)
      at Object.onInvokeTask (main-es2015.644493e96d36e42b4744.js:formatted:15108:35)
      at l.invokeTask (polyfills-es2015.1f03f79e7b3f74395f0f.js:1:7163)
      at i.runTask (polyfills-es2015.1f03f79e7b3f74395f0f.js:1:2651)
      at m (polyfills-es2015.1f03f79e7b3f74395f0f.js:1:9236)
      at u.invokeTask [as invoke] (polyfills-es2015.1f03f79e7b3f74395f0f.js:1:8321)
      at p (polyfills-es2015.1f03f79e7b3f74395f0f.js:1:20575)
  on @ main-es2015.644493e96d36e42b4744.js:formatted:11155
  main-es2015.644493e96d36e42b4744.js:formatted:25818

  loadSongData: 92239.93823242188 ms
NBS-LLC commented 1 year ago

I appreciate all of the feedback and research you did, thank you :)

Is this still an issue? I tried to replicate it and I'm not getting a 404 for this song. Instead I'm seeing what I would expect, "unknown song" in the UI. I noticed that if I remove everything after "21" in the title and click the refresh button the song is then found. At which point I can import the playlist.

I'm curious if the session expired since it took ~92 seconds to load all of the song data (from your screenshot). Have you tried importing with similar sized or larger playlists?

NBS-LLC commented 1 year ago

Closing this ticket due to lack of activity.

Version 1.4.0 has been deployed to production today. If this remains an issue please submit a new ticket.