-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Minor improvements to deezer plugin typing. #5814
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
Conversation
Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request enhances the Deezer plugin by adding and refining type hints to improve code maintainability and prepare for an upcoming migration.
- Updated function signatures with type hints (e.g. commands, track_for_id, _get_track, _search_api).
- Re-ordered and consolidated API URLs and fetch_data implementation.
- Adjusted imports and type annotations across both beetsplug/deezer.py and beets/plugins.py.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
beetsplug/deezer.py | Added type hints, updated function parameters/docstrings, and moved API URL definitions. |
beets/plugins.py | Updated _search_api type hints for query_type using Literal. |
Comments suppressed due to low confidence (1)
beetsplug/deezer.py:149
- The docstring for track_for_id still references a track_data parameter that was removed from the function signature. Please update the documentation to reflect the current parameters.
:param track_data: (Optional) Simplified track object dict. May be provided instead of ``track_id`` to avoid unnecessary API calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to isolate method moves into a separate commit? It's a bit complicated to see the relevant changes when the entire method implementations are red and green 😅
Not sure if you've seen my review comment
Would you be happy to do so? |
Sure, the moves should now be contained in one commit. I also added that one to the .git-blame-ignore-revs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aplogies, didn't realise that I forgot to submit this review 🤦🏼 . Just a pair of small questions
## Description Added some more typehints to the spotify plugin. Also added a method to get the tokenfile and changed to logic for the handle_response to use `requests.request`. This is done mainly to prepare for beetbox#5787, see also beetbox#5814
Description
Added some more typehints to deezer plugin.
I know, it is properly not used much and we don't even have test for the deezer plugin but I want to make this a bit more maintainable, mainly to prepare for #5787 and make migration a bit easier.