pylast: get_userplaycount() always returning 0
What did you do?
Tried to get the user play count for a track.
What did you expect to happen?
Get the correct value. 56 or more in this case.
What actually happened?
Always returns 0.
What versions of OS, Python and pylast are you using?
- Linux 5.2.0-rc3
- Python 3.7.3
- pylast 3.1.0
Please include code that reproduces the issue.
>>> import pylast
>>> network = pylast.LastFMNetwork(api_key='xxx', api_secret='xxx')
>>> track = pylast.Track(artist='Slayer', title='Seasons in the Abyss', network=network, username='falso')
>>> track.get_userplaycount()
0
I also looked at the unit tests, and it seems do be doing it the same way I do, but it its testing for a track that doesnt exist so probably always returns 0.
https://github.com/pylast/pylast/blob/6a1a5a450ef14feb82e87f22805434873ce55b6d/tests/test_track.py#L48-L60 If I make the API request on the browser:
It returns the “userplaycount” attribute there, and its not 0.
Is this a bug, or I’m using it wrongly?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 20 (6 by maintainers)
@hugovk It works !
Heres an updated diff: