New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage example from README not works #59
Comments
Thanks for the report, it looks like a bug! I think it worked at some point, but it's obviously not working anymore. It's probably that the client methods aren't returning the proper classes, but the base > ipython
Python 3.6.8 (default, Jan 19 2019, 12:07:51)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import deezer
In [2]: client = deezer.Client()
In [3]: client.search('Discovery')[0]
Out[3]: <Track: One More Time>
In [4]: client.search('Discovery')[0].get_album()
Out[4]: <Album: Discovery>
In [5]: client.search('Discovery')[0].get_album().title
Out[5]: 'Discovery' However, when trying to get the album directly, the type is a
There is a similar problem when trying to get other object types, like artists, track, etc... |
The problem here is that the album 12 does not exist, and the method default to returning Ressource type.
So this issue is more about error handling.
|
Good find! Agree that the error should be made explicit, and raise an exception. Also we should not default to Resource type when no suitable resource type is found. Also the README should be updated too I think. |
@all-contributors please add @spvkgn for bug |
I've put up a pull request to add @spvkgn! 🎉 |
@all-contributors please add @spvkgn for bug |
I've put up a pull request to add @spvkgn! 🎉 |
Am i do something wrong in this?
The text was updated successfully, but these errors were encountered: