Mopidy add to tracklist returns an empty array

Hi, we just updated our Mopidy install to 2.0 due to the spotify API migration changes and everything seems to be working fine except for the following:

Some specific uri’s causes the mopidy.tracklist.add(…) method to return an empty array.

A example using js with a song that always returns an empty array for me:

var spotifyTrackURI = "spotify:track:5hZ1sM6SGuZwmPt1KiFj5M";
mopidy.tracklist.add(null, null, spotifyTrackURI, null).then(function (data) {
      console.log(data);  // data is now [ ];
      if (data.length > 0) {
          mopidy.playback.play(data[0]).then(function () {
             console.log("playing a track ");
          });
       }
});

I was not able to find any significant logs on the mopidy debug log. Any suggestions why is this happening? It was working fine on 1.1.0.

I can’t immediately see anything wrong with your code. I’d generally recommend setting callingConvention to by-position-or-by-name, ref https://docs.mopidy.com/en/latest/api/js/#creating-an-instance. That would let you write mopidy.tracklist.add({uri: spotifyTrackURI}), which I find a whole lot more readable than all the positional nulls.

I just tried your code myself on Mopidy 2.0.0, and it seems to work nicely.