Skip to content

Commit

Permalink
Make options optional for more playback endpoints. Fixes #115. (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgrieger authored and JMPerez committed Oct 22, 2018
1 parent 84a3963 commit 65c7c71
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
28 changes: 21 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/spotify-web-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,7 @@ var SpotifyWebApi = (function() {
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
*/
Constr.prototype.seek = function(position_ms, options, callback) {
options = options || {};
var params = {
position_ms: position_ms
};
Expand All @@ -1615,6 +1616,7 @@ var SpotifyWebApi = (function() {
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
*/
Constr.prototype.setRepeat = function(state, options, callback) {
options = options || {};
var params = {
state: state
};
Expand All @@ -1641,6 +1643,7 @@ var SpotifyWebApi = (function() {
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
*/
Constr.prototype.setVolume = function(volume_percent, options, callback) {
options = options || {};
var params = {
volume_percent: volume_percent
};
Expand All @@ -1667,6 +1670,7 @@ var SpotifyWebApi = (function() {
* @return {Object} Null if a callback is provided, a `Promise` object otherwise
*/
Constr.prototype.setShuffle = function(state, options, callback) {
options = options || {};
var params = {
state: state
};
Expand Down

0 comments on commit 65c7c71

Please sign in to comment.