validate url

This commit is contained in:
Snowflake107 2021-05-11 18:46:07 +05:45
parent 7a8ed2414e
commit 59fdcbf032

View file

@ -65,8 +65,8 @@ export class Util {
* @returns {QueryType}
*/
static getQueryType(query: string): QueryType {
if (SoundcloudValidateURL(query) && !query.includes('/sets/')) return 'soundcloud_track';
if (SoundcloudValidateURL(query) && query.includes('/sets/')) return 'soundcloud_playlist';
if (SoundcloudValidateURL(query, 'track')) return 'soundcloud_track';
if (SoundcloudValidateURL(query, 'playlist') || query.includes('/sets/')) return 'soundcloud_playlist';
if (spotifySongRegex.test(query)) return 'spotify_song';
if (spotifyAlbumRegex.test(query)) return 'spotify_album';
if (spotifyPlaylistRegex.test(query)) return 'spotify_playlist';