mirror of
https://github.com/c0de-archive/spotipy.git
synced 2024-11-05 07:27:47 +00:00
Merge branch 'master' into support_changing_playlist_details
This commit is contained in:
commit
7c5bfbdf86
@ -1,5 +1,4 @@
|
|||||||
|
# shows a user's saved tracks (need to be authenticated via oauth)
|
||||||
# Adds tracks to a playlist
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import spotipy
|
import spotipy
|
||||||
|
@ -497,6 +497,17 @@ class Spotify(object):
|
|||||||
return self._delete("users/%s/playlists/%s/tracks" % (user, plid),
|
return self._delete("users/%s/playlists/%s/tracks" % (user, plid),
|
||||||
payload=payload)
|
payload=payload)
|
||||||
|
|
||||||
|
def user_playlist_follow_playlist(self, playlist_owner_id, playlist_id):
|
||||||
|
'''
|
||||||
|
Add the current authenticated user as a follower of a playlist.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
- playlist_owner_id - the user id of the playlist owner
|
||||||
|
- playlist_id - the id of the playlist
|
||||||
|
|
||||||
|
'''
|
||||||
|
return self._put("users/{}/playlists/{}/followers".format(playlist_owner_id, playlist_id))
|
||||||
|
|
||||||
def me(self):
|
def me(self):
|
||||||
''' Get detailed profile information about the current user.
|
''' Get detailed profile information about the current user.
|
||||||
An alias for the 'current_user' method.
|
An alias for the 'current_user' method.
|
||||||
|
@ -83,7 +83,7 @@ class TestSpotipy(unittest.TestCase):
|
|||||||
self.assertTrue('artists' in results)
|
self.assertTrue('artists' in results)
|
||||||
self.assertTrue(len(results['artists']) == 20)
|
self.assertTrue(len(results['artists']) == 20)
|
||||||
for artist in results['artists']:
|
for artist in results['artists']:
|
||||||
if artist['name'] == 'Rivers Cuomo':
|
if artist['name'] == 'Jimmy Eat World':
|
||||||
found = True
|
found = True
|
||||||
self.assertTrue(found)
|
self.assertTrue(found)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user