Skip to content

Warning on Spotify URI RegEx fail#1225

Open
dieser-niko wants to merge 1 commit intomasterfrom
feature/invalid-uri-warning
Open

Warning on Spotify URI RegEx fail#1225
dieser-niko wants to merge 1 commit intomasterfrom
feature/invalid-uri-warning

Conversation

@dieser-niko
Copy link
Member

Closes #1221

While implementing, I noticed that such a warning would probably be more disruptive than helpful.
Currently there are multiple methods that should accept both tracks and episodes, but the regex only checks for tracks.

Any thoughts?

@dieser-niko dieser-niko linked an issue Dec 23, 2025 that may be closed by this pull request
@dieser-niko dieser-niko marked this pull request as ready for review December 23, 2025 18:57
Copy link

@tinomen tinomen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this message


def _get_uri(self, type, id):
if self._is_uri(id):
warnings.warn(f"{repr(id)} did not match the Spotify URI RegEx.", UserWarning)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be more explicit that it is the Spotify API, since this is quite possible from the spotify apps. I know this is an API library and should be assumed given that context, but ... people.

did not match the Spotify API URI RegEx.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you want in there? Not sure what kind of information we can throw into that message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local Tracks Not Recognized as URI

2 participants