Search function fixed

This commit is contained in:
killer069
2021-10-21 14:54:53 +05:30
parent e69f466f53
commit f410483980
3 changed files with 3 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ export async function search(
options: SearchOptions = {}
): Promise<YouTube[] | Spotify[] | SoundCloud[]> {
if (!options.source) options.source = { youtube: 'video' };
query = encodeURIComponent(query)
if (options.source.youtube) return await yt_search(query, { limit: options.limit, type: options.source.youtube });
else if (options.source.spotify) return await sp_search(query, options.source.spotify, options.limit);
else if (options.source.soundcloud) return await so_search(query, options.source.soundcloud, options.limit);