Skip to content

Commit

Permalink
Added option to extend data requested for a song or songs.
Browse files Browse the repository at this point in the history
  • Loading branch information
j-jacobson committed Aug 22, 2023
1 parent 3833163 commit 5561842
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions applemusicpy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def playlists(self, playlist_ids, storefront='us', l=None, include=None):
return self._get_multiple_resources(playlist_ids, 'playlists', storefront=storefront, l=l,
include=include)

def song(self, song_id, storefront='us', l=None, include=None):
def song(self, song_id, storefront='us', l=None, include=None, extend=None):
"""
Get a catalog Song by ID
Expand All @@ -486,7 +486,7 @@ def song(self, song_id, storefront='us', l=None, include=None):
:return: Song data in JSON format
"""
return self._get_resource(song_id, 'songs', storefront=storefront, l=l, include=include)
return self._get_resource(song_id, 'songs', storefront=storefront, l=l, include=include, extend=extend)

def song_relationship(self, song_id, relationship, storefront='us', l=None, limit=None, offset=None):
"""
Expand All @@ -501,10 +501,9 @@ def song_relationship(self, song_id, relationship, storefront='us', l=None, limi
:return: A List of relationship data in JSON format
"""
return self._get_resource_relationship(song_id, 'songs', relationship, storefront=storefront, l=l,
limit=limit, offset=offset)
return self._get_resource_relationship(song_id, 'songs', relationship, storefront=storefront, l=l, limit=limit, offset=offset)

def songs(self, song_ids, storefront='us', l=None, include=None):
def songs(self, song_ids, storefront='us', l=None, include=None, extend=None):
"""
Get all catalog song data associated with the IDs provided
Expand All @@ -515,9 +514,9 @@ def songs(self, song_ids, storefront='us', l=None, include=None):
:return: A list of catalog song data in JSON format
"""
return self._get_multiple_resources(song_ids, 'songs', storefront=storefront, l=l, include=include)
return self._get_multiple_resources(song_ids, 'songs', storefront=storefront, l=l, include=include, extend=extend)

def songs_by_isrc(self, isrcs, song_ids=None, storefront='us', l=None, include=None):
def songs_by_isrc(self, isrcs, song_ids=None, storefront='us', l=None, include=None, extend=None):
"""
Get all catalog songs associated with the ISRCs provided
Expand All @@ -530,7 +529,7 @@ def songs_by_isrc(self, isrcs, song_ids=None, storefront='us', l=None, include=N
:return: A list of catalog song data in JSON format
"""
return self._get_resource_by_filter('isrc', isrcs, 'songs', resource_ids=song_ids,
storefront=storefront, l=l, include=include)
storefront=storefront, l=l, include=include, extend=extend)

def artist(self, artist_id, storefront='us', l=None, include=None):
"""
Expand Down

0 comments on commit 5561842

Please sign in to comment.