Skip to content

Commit

Permalink
Merge pull request #1 from okonek/patch-1
Browse files Browse the repository at this point in the history
Patch 1
  • Loading branch information
okonek authored Apr 1, 2018
2 parents 5a17958 + 696a0c8 commit c3c13d9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function TidalAPI(authData) {
* Try login using credentials.
* @param {{username: String, password: String}}
*/
function tryLogin(authInfo, cb) {
TidalApi.prototype.tryLogin = function (authInfo, cb) {
/**
* Logging?
* @type {boolean}
Expand Down Expand Up @@ -332,6 +332,18 @@ TidalAPI.prototype.getUser = function (user, callback) {
offset: user.offset || 0
}, 'user', callback);
}
/**
* Get user playlists.
* @param {{id: Number}}
*/
TidalAPI.prototype.getPlaylists = function (user, callback) {
var self = this;
self._baseRequest('/users/' + (user.id || user) + "/playlists", {
limit: user.limit || 999,
offset: user.offset || 0,
countryCode: _countryCode
}, 'userPlaylists', callback);
}

/**
* Get track stream URL.
Expand Down

0 comments on commit c3c13d9

Please sign in to comment.