Home Reference Source
import NewHitsPlaylistFetcher from '@kkbox/kkbox-js-sdk/src/api/NewHitsPlaylistFetcher.js'
public class | source

NewHitsPlaylistFetcher

Extends:

Fetcher → NewHitsPlaylistFetcher

List new hits playlists.

See:

Method Summary

Public Methods
public

Fetch all new hits playlists.

public

Fetch metadata of the new hits playlist you set.

public

fetchTracks(limit: number, offset: number): Promise

Fetch tracks of the new hits playlist you set.

public

Init the new hits playlist fetcher.

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 fetchAllNewHitsPlaylists(limit: number, offset: number): Promise source

Fetch all new hits playlists.

Params:

NameTypeAttributeDescription
limit number
  • optional

The size of one page.

offset number
  • optional

The offset index for first element.

Return:

Promise

Example:

api.newHitsPlaylistFetcher.fetchAllNewHitsPlaylists();

See:

public fetchMetadata(): Promise source

Fetch metadata of the new hits playlist you set.

Return:

Promise

Example:

api.newHitsPlaylistFetcher.setPlaylistID('DZrC8m29ciOFY2JAm3').fetchMetadata();

See:

public fetchTracks(limit: number, offset: number): Promise source

Fetch tracks of the new hits playlist you set. Result will be paged.

Params:

NameTypeAttributeDescription
limit number
  • optional

The size of one page.

offset number
  • optional

The offset index for first element.

Return:

Promise

Example:

api.newHitsPlaylistFetcher.setPlaylistID('DZrC8m29ciOFY2JAm3').fetchTracks();

See:

public setPlaylistID(playlistID: string): NewHitsPlaylistFetcher source

Init the new hits playlist fetcher.

Params:

NameTypeAttributeDescription
playlistID string

The playlist ID.

See: