add warning when regex for uri fails

This commit is contained in:
Niko 2025-12-23 19:39:54 +01:00
parent 179d3e486c
commit 051e6d49af
2 changed files with 3 additions and 0 deletions

View File

@ -11,6 +11,8 @@ Add your changes below.
### Added ### Added
- Added a warning if the URI regex did not match the input.
### Fixed ### Fixed
### Removed ### Removed

View File

@ -2140,6 +2140,7 @@ class Spotify:
def _get_uri(self, type, id): def _get_uri(self, type, id):
if self._is_uri(id): if self._is_uri(id):
warnings.warn(f"{repr(id)} did not match the Spotify URI RegEx.", UserWarning)
return id return id
else: else:
return "spotify:" + type + ":" + self._get_id(type, id) return "spotify:" + type + ":" + self._get_id(type, id)