Method Summary
| Public Methods | ||
| public |
fetchSearchResult(limit: number, offset: number): Promise Fetch the search result. |
|
| public |
Filter what you don't want when search. |
|
| public |
setSearchCriteria(q: string, type: string): Search Init the search fetcher for the artist, album, track or playlist. |
|
Inherited Summary
| From class Fetcher | ||
| public |
fetchNextPage(fulfillment: fulfillment, nextUriPath: String): Promise Fetches next page of various paged APIs. |
|
| public |
hasNextPage(fulfillment: fulfillment, nextUriPath: String): Boolean Is next page available for various paged APIs. |
|
| public |
setTerritory(territory: string): Fetcher Set the fetcher's territory. |
|
Public Methods
public fetchSearchResult(limit: number, offset: number): Promise source
Fetch the search result.
Example:
api.searchFetcher
.setSearchCriteria('五月天 好好')
.fetchSearchResult();
public filter(conditions: Object): Search source
Filter what you don't want when search.
Params:
| Name | Type | Attribute | Description |
| conditions | Object |
|
search conditions. |
| conditions.track | string | track's name. |
|
| conditions.album | string | album's name. |
|
| conditions.artist | string | artist's name. |
|
| conditions.playlist | string | playlist's title. |
|
| conditions.availableTerritory | string | tracks and albums available territory. |
Return:
| Search |
Example:
api.searchFetcher
.setSearchCriteria('五月天 好好')
.filter({artist: '五月天'})
.fetchSearchResult();
