Skip to content

Commit

Permalink
Added $options argument to SpotifyWebAPi::getAlbum() (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
yekici authored and jwilsson committed Aug 27, 2019
1 parent d2d5e46 commit e92121f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/SpotifyWebAPI.php
Expand Up @@ -532,17 +532,19 @@ public function followPlaylistForCurrentUser($playlistId, $options = [])
* https://developer.spotify.com/documentation/web-api/reference/albums/get-album/
*
* @param string $albumId ID or Spotify URI of the album.
* @param array|object $options Optional. Options for the albums.
* - string market Optional. An ISO 3166-1 alpha-2 country code, provide this if you wish to apply Track Relinking.
*
* @return array|object The requested album. Type is controlled by `SpotifyWebAPI::setReturnType()`.
*/
public function getAlbum($albumId)
public function getAlbum($albumId, $options = [])
{
$headers = $this->authHeaders();

$albumId = $this->uriToId($albumId, 'album');
$uri = '/v1/albums/' . $albumId;

$this->lastResponse = $this->request->api('GET', $uri, [], $headers);
$this->lastResponse = $this->request->api('GET', $uri, $options, $headers);

return $this->lastResponse['body'];
}
Expand Down

0 comments on commit e92121f

Please sign in to comment.