adibaewa / pylast

Automatically exported from code.google.com/p/pylast
Apache License 2.0
0 stars 0 forks source link

User.fetchPlaylist #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please type example code that produces the issue:

user = User('RJ', API_KEY, API_SECRET, SESSION_KEY) 
for playlist in user.getPlaylistIDs() :
    user.fetchPlaylist(playlist['id'])

What is the expected output? What do you see instead?

I expect the playlist, instead I see this:

  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-
packages/pylast.py", line 2376, in fetchPlaylist
    return Playlist(uri, self.api_key).fetch()
TypeError: __init__() takes exactly 5 arguments (3 given)

What version of pyLast is this?

0.2b11

Please provide any additional information below.

I think the problem is in the definition of User.fetchPlaylist
While the fetchPlaylist function of other classes returns:
    return Playlist(uri, *self.auth_data).fetch()
using self.auth_data,
the fetchPlaylist function of the class User returns:
    return Playlist(uri, self.api_key).fetch()

Original issue reported on code.google.com by claud...@gmail.com on 16 Oct 2008 at 9:11

GoogleCodeExporter commented 9 years ago
Fixed in 0.2b12.
I also changed the returns of User.getPlaylistIDs to return only a list of IDs. 
The
old function can be found now under User.getPlaylistsData.
Thank you for taking the time to report this.

Original comment by amr.hassan on 16 Oct 2008 at 12:55