xgate1 / pylast

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

Album.get_top_tracks does not return TopItems #85

Open GoogleCodeExporter opened 8 years ago

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

>>> import pylast
>>> LASTFM = pylast.LastFMNetwork(api_key='7944f1609952ddbd9e6482b2fa29a732')
>>> for album in LASTFM.get_user('RJ').get_top_albums():
>>>   for tag in album.item.get_top_tags():
...     print(u'{}[{}]'.format(tag.item.get_name(), tag.item.weight))

AttributeError                            Traceback (most recent call last)
/data/tmp/sync1/<ipython-input-8-375145d0a992> in <module>()
      1 for album in LASTFM.get_user('RJ').get_top_albums():
      2       for tag in album.item.get_top_tags():
----> 3             print(u'{}[{}]'.format(tag.item.get_name(), 
tag.item.weight))
      4 

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

I would have expected to get a sequence of TopItems, similar to 
artist.get_top_tags() and track.get_top_tags().

What versions of Pylast and Python are you using?

Python 2.7.3
pylast-0.5.11.tar.gz (installed with pip)

Please provide any additional information below.

pylast uses Album.getInfo instead of Album.getTopTags to get the top tags.  
Deleteing get_top_tags from the Album class fixed this issue for me.

Cheers,
  Peter

Original issue reported on code.google.com by pschne...@gmail.com on 15 Oct 2013 at 8:52

GoogleCodeExporter commented 8 years ago
Fixed in my fork: https://github.com/hugovk/pylast/issues/86

Original comment by hugovk@gmail.com on 2 Mar 2014 at 8:02