Skip to content
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

client.get_chart fails #132

Closed
hithomasmorelli opened this issue Aug 17, 2020 · 2 comments · Fixed by #134
Closed

client.get_chart fails #132

hithomasmorelli opened this issue Aug 17, 2020 · 2 comments · Fixed by #134
Labels
bug Something isn't working

Comments

@hithomasmorelli
Copy link
Contributor

Discovered when testing/fixing #127

Calling client.get_chart() results in the following stack trace:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/deezer-python/deezer/client.py", line 213, in get_chart
    return self.get_object(
  File "/deezer-python/deezer/client.py", line 205, in get_object
    return self._process_json(json, parent)
  File "/deezer-python/deezer/client.py", line 120, in _process_json
    value = self._process_json(value, parent)
  File "/deezer-python/deezer/client.py", line 115, in _process_json
    return [self._process_json(i, parent) for i in item["data"]]
  File "/deezer-python/deezer/client.py", line 115, in <listcomp>
    return [self._process_json(i, parent) for i in item["data"]]
  File "/deezer-python/deezer/client.py", line 126, in _process_json
    object_class = self.objects_types[result["type"]]
KeyError: 'podcast'

Will attempt to fix and introduce a PR

@hithomasmorelli
Copy link
Contributor Author

I suspect that Deezer has changed their API responses a bit as the tests for this that use the cassettes don't fail

@hithomasmorelli
Copy link
Contributor Author

hithomasmorelli commented Aug 18, 2020

right, so this is caused by podcast not being in Client.objects_types. I'll create a new resources.Podcast class and introduce a few Playlist methods when fixing this.

hithomasmorelli added a commit to hithomasmorelli/deezer-python that referenced this issue Aug 18, 2020
 - created a (so far empty) Podcast(Resource) class
 - import it in client.py and add it to Client.objects_types as "podcast"
 - update test cassette files (with the new podcast data)
 - updates existing tests (to check for the now-changed cassette data)
@browniebroke browniebroke added the bug Something isn't working label Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants