Skip to content

Commit ea548e0

Browse files
committed
Merge add to queue
1 parent bc0b8c9 commit ea548e0

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

__test__/spotify-web-api.spec.js

-13
Original file line numberDiff line numberDiff line change
@@ -1678,19 +1678,6 @@ describe('Basic tests', function () {
16781678
expect(that.requests[0].url).toBe('https://api.spotify.com/v1/me/player');
16791679
});
16801680

1681-
it('should queue', function () {
1682-
var callback = sinon.spy();
1683-
var api = new SpotifyWebApi();
1684-
api.queue('spotify:track:1301WleyT98MSxVHPZCA6M', callback);
1685-
that.requests[0].respond(204);
1686-
expect(that.requests[0].method).toBe('POST');
1687-
expect(callback.calledWith(null, '')).toBeTruthy();
1688-
expect(that.requests.length).toBe(1);
1689-
expect(that.requests[0].url).toBe(
1690-
'https://api.spotify.com/v1/me/player/queue?uri=spotify%3Atrack%3A1301WleyT98MSxVHPZCA6M'
1691-
);
1692-
});
1693-
16941681
it('should play', function () {
16951682
var callback = sinon.spy();
16961683
var api = new SpotifyWebApi();

src/spotify-web-api.js

-36
Original file line numberDiff line numberDiff line change
@@ -1617,42 +1617,6 @@ var SpotifyWebApi = (function () {
16171617
return _checkParamsAndPerformRequest(requestData, options, callback);
16181618
};
16191619

1620-
/**
1621-
* Add a track to the queue on the user's active device
1622-
* See [Add an Item to the User's Playback Queue](https://developer.spotify.com/documentation/web-api/reference/player/add-to-queue/) on
1623-
* the Spotify Developer site for more information about the endpoint.
1624-
*
1625-
* @param {string} track_uri The track to add to the queue
1626-
* @param {Object} options A JSON object with options that can be passed.
1627-
* @param {function(Object,Object)} callback An optional callback that receives 2 parameters. The first
1628-
* one is the error object (null if no error), and the second is the value if the request succeeded.
1629-
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
1630-
*/
1631-
Constr.prototype.queue = function (track_uri, options, callback) {
1632-
options = options || {};
1633-
var params =
1634-
'device_id' in options ? { device_id: options.device_id } : null;
1635-
if ('device_id' in options) {
1636-
params = {
1637-
uri: track_uri,
1638-
device_id: options.device_id
1639-
};
1640-
} else {
1641-
params = {
1642-
uri: track_uri
1643-
};
1644-
}
1645-
var requestData = {
1646-
type: 'POST',
1647-
url: _baseUri + '/me/player/queue',
1648-
params: params
1649-
};
1650-
1651-
// need to clear options so it doesn't add all of them to the query params
1652-
var newOptions = typeof options === 'function' ? options : {};
1653-
return _checkParamsAndPerformRequest(requestData, newOptions, callback);
1654-
};
1655-
16561620
/**
16571621
* Play a track on the user's active device
16581622
* See [Start/Resume a User's Playback](https://developer.spotify.com/documentation/web-api/reference/player/start-a-users-playback/) on

0 commit comments

Comments
 (0)