Fixed Spotify Playlist and Album search issues

This commit is contained in:
killer069
2021-12-15 13:11:16 +05:30
parent 2958e65728
commit 6fbb0e96de
3 changed files with 30 additions and 176 deletions

View File

@@ -19,8 +19,7 @@ export {
SpotifyAlbum,
SpotifyPlaylist,
SpotifyTrack,
Spotify,
SpotifySearch
Spotify
} from './Spotify';
export {
soundcloud,
@@ -73,7 +72,7 @@ import {
SoundCloud,
Spotify
} from '.';
import { SpotifyAuthorize, SpotifySearch, sp_search } from './Spotify';
import { SpotifyAuthorize, sp_search } from './Spotify';
import { check_id, so_search, stream as so_stream, stream_from_info as so_stream_info } from './SoundCloud';
import { stream as yt_stream, StreamOptions, stream_from_info as yt_stream_info } from './YouTube/stream';
import { SoundCloudPlaylist, SoundCloudTrack } from './SoundCloud/classes';
@@ -214,7 +213,7 @@ export async function search(query: string, options?: SearchOptions): Promise<Yo
export async function search(
query: string,
options: SearchOptions = {}
): Promise<YouTube[] | SpotifySearch[] | SoundCloud[] | Deezer[]> {
): Promise<YouTube[] | Spotify[] | SoundCloud[] | Deezer[]> {
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 });