Home Reference Source
public class | source

AlbumFetcher

Extends:

Fetcher → AlbumFetcher

Fetch metadata and tracks of a album.

See:

Method Summary

Public Methods
public

Fetch metadata of the album you create.

public

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

Get tracks in an album.

public

Get KKBOX web widget uri of the album.

public

Set the album 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 fetchMetadata(): Promise source

Fetch metadata of the album you create.

Return:

Promise

Example:

api.albumFetcher.setAlbumID('KmRKnW5qmUrTnGRuxF').fetchMetadata();

See:

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

Get tracks in an album. Result will be return with pagination.

Params:

NameTypeAttributeDescription
limit number
  • optional

The size for one page.

offset number
  • optional

The offset index for first element.

Return:

Promise

Example:

api.albumFetcher.setAlbumID('KmRKnW5qmUrTnGRuxF').fetchTracks();

See:

public getWidgetUri(): string source

Get KKBOX web widget uri of the album.

Return:

string

Example:

https://widget.kkbox.com/v1/?id=4qtXcj31wYJTRZbb23&type=album

public setAlbumID(albumID: string): AlbumFetcher source

Set the album fetcher.

Params:

NameTypeAttributeDescription
albumID string

The ID of an album.

Return:

AlbumFetcher

See: