Restyled by black
This commit is contained in:
@@ -17,15 +17,13 @@ class ArtistId(SpotifyId.SpotifyId):
|
||||
matcher = ArtistId._PATTERN.search(uri)
|
||||
if matcher is not None:
|
||||
artist_id = matcher.group(1)
|
||||
return ArtistId(
|
||||
Utils.bytes_to_hex(ArtistId._BASE62.decode(artist_id, 16)))
|
||||
return ArtistId(Utils.bytes_to_hex(ArtistId._BASE62.decode(artist_id, 16)))
|
||||
else:
|
||||
raise TypeError("Not a Spotify artist ID: {}".format(uri))
|
||||
|
||||
@staticmethod
|
||||
def from_base62(base62: str) -> ArtistId:
|
||||
return ArtistId(Utils.bytes_to_hex(ArtistId._BASE62.decode(base62,
|
||||
16)))
|
||||
return ArtistId(Utils.bytes_to_hex(ArtistId._BASE62.decode(base62, 16)))
|
||||
|
||||
@staticmethod
|
||||
def from_hex(hex_str: str) -> ArtistId:
|
||||
@@ -36,7 +34,8 @@ class ArtistId(SpotifyId.SpotifyId):
|
||||
|
||||
def to_spotify_uri(self) -> str:
|
||||
return "spotify:artist:{}".format(
|
||||
ArtistId._BASE62.encode(Utils.hex_to_bytes(self._hexId)))
|
||||
ArtistId._BASE62.encode(Utils.hex_to_bytes(self._hexId))
|
||||
)
|
||||
|
||||
def hex_id(self) -> str:
|
||||
return self._hexId
|
||||
|
||||
Reference in New Issue
Block a user