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

[Artist.get_radio] All tracks have the parent as artist #1210

Closed
2 tasks done
tdambrin opened this issue Dec 4, 2024 · 0 comments · Fixed by #1211
Closed
2 tasks done

[Artist.get_radio] All tracks have the parent as artist #1210

tdambrin opened this issue Dec 4, 2024 · 0 comments · Fixed by #1211
Labels
bug Something isn't working

Comments

@tdambrin
Copy link
Contributor

tdambrin commented Dec 4, 2024

Describe the bug

In src/deezer/resources/artist.py
The Artist.get_radio method returns a list of tracks with the caller artist as the artist.
A radio is composed of tracks that are from other artists from the most part (did not test with less popular artists).

To Reproduce

Environment

(dzp) Thomass-MBP:deezer_python tdambrin$ pip show deezer-python
Name: deezer-python
Version: 7.1.0
Summary: A friendly wrapper library for the Deezer API
Home-page: https://github.com/browniebroke/deezer-python
Author: Bruno Alla
Author-email: alla.brunoo@gmail.com
License: MIT
Location: /Users/tdambrin/.pyenv/versions/3.13.0/envs/dzp/lib/python3.13/site-packages
Editable project location: /Users/tdambrin/Documents/proj/deezer_python
Requires: httpx
Required-by: 

Reproduce

import requests

from deezer import Client

daft_punk = Client().get_artist(27)
radio_ = daft_punk.get_radio()

raw_response = requests.get("https://api.deezer.com/artist/27/radio").json()
assert any(track_['artist']['name'] != daft_punk.name for track_ in raw_response['data']), (
    "Raw Radio response returned only Daft Punk songs"
)

# Issue - Artist forwarded as track artist by src.deezer.client:L116
unique_artists_names = {}
assert any(track_.artist.name != daft_punk.name for track_ in radio_), (
    f"All radio tracks have {daft_punk} as an Artist"
)

Additional context

→ Fix proposed in PR

Thanks for the package, it's greatly made!

Version

7.1.0

Platform

macOS 14.2.1

Code of Conduct

  • I agree to follow this project's Code of Conduct.

No Duplicate

  • I have checked existing issues to avoid duplicates.
@tdambrin tdambrin added the bug Something isn't working label Dec 4, 2024
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.

1 participant