Skip to content

Conversation

semohr
Copy link
Contributor

@semohr semohr commented Jun 2, 2025

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.

@Copilot Copilot AI review requested due to automatic review settings June 2, 2025 11:24
Copy link

github-actions bot commented Jun 2, 2025

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.

Copy link
Contributor

@Copilot Copilot AI left a 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.

semohr added a commit that referenced this pull request Jun 11, 2025
## 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
#5787, see also
#5814
Copy link
Member

@snejus snejus left a 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 😅

@snejus
Copy link
Member

snejus commented Jun 22, 2025

Not sure if you've seen my review comment

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 😅

Would you be happy to do so?

@semohr
Copy link
Contributor Author

semohr commented Jun 24, 2025

Not sure if you've seen my review comment

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 😅

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

Copy link
Member

@snejus snejus left a 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

@snejus snejus merged commit f461651 into master Jul 7, 2025
20 checks passed
@snejus snejus deleted the deezer_typing branch July 7, 2025 11:14
peterjdolan pushed a commit to peterjdolan/beets that referenced this pull request Jul 27, 2025
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants