mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-01 14:38:48 +00:00
Add logging to duplicate /track/id in spotify url
This commit is contained in:
1 parent
5d9941dabe
commit
b689b024ac
1 file changed
+1
@@ -32,6 +32,7 @@ export const transformQuery = ({ query, executionId }: TransformQueryParams) =>
|
||||
const trackIdRegex: RegExp = new RegExp('https://open.spotify.com/track/([a-zA-Z0-9]+)');
|
||||
const trackIdMatches: RegExpMatchArray | null = query.match(trackIdRegex);
|
||||
if (trackIdMatches) {
|
||||
logger.debug(`Transforming Spotify url to remove duplicate track id from query '${query}'.`);
|
||||
const trackId: string = trackIdMatches[1];
|
||||
query = `https://open.spotify.com/track/${trackId}`;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user