SearchResult
new SearchResult(player, _data)
Parameter | Type | Optional | Description |
---|---|---|---|
player | Player | ❌ | - |
_data | SearchResultData | ❌ | - |
Properties
private _data: SearchResultData
public player: Player
public extractor: null | BaseExtractor
The extractor
public playlist: undefined | null | Playlist
Playlist result
public query: string
The search query
public queryType: SearchQueryType | any
The search query type
public requestedBy: null | User
Requested by
public tracks: Array<Track>
Tracks result
Methods
public execute(): Promise<SearchResult>
Re-execute this search
public hasPlaylist(): boolean
If this search result has playlist
public hasTracks(): boolean
If this search result has tracks
public isEmpty(): boolean
If this search result is empty
public setExtractor(extractor): SearchResult
Parameter | Type | Optional | Description |
---|---|---|---|
extractor | BaseExtractor | ❌ | - |
public setPlaylist(playlist): SearchResult
Parameter | Type | Optional | Description |
---|---|---|---|
playlist | Playlist | ❌ | - |
public setQuery(query): SearchResult
Parameter | Type | Optional | Description |
---|---|---|---|
query | string | ❌ | - |
public setQueryType(type): SearchResult
Parameter | Type | Optional | Description |
---|---|---|---|
type | SearchQueryType | any | ❌ | - |
public setRequestedBy(user): SearchResult
Parameter | Type | Optional | Description |
---|---|---|---|
user | User | ❌ | - |
public setTracks(tracks): SearchResult
Parameter | Type | Optional | Description |
---|---|---|---|
tracks | Array<Track> | ❌ | - |
public toJSON(): { extractor: null | string,playlist: null | PlaylistJSON,query: string,queryType: SearchQueryType | any,requestedBy: null | Object,tracks: Array<TrackJSON> }
JSON representation of this search