Home Reference Source
public class | source

ArtistFetcher

Extends:

Fetcher → ArtistFetcher

Get artist metadata.

See:

Method Summary

Public Methods
public

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

Fetch albums belong to an artist.

public

Fetch metadata of the artist you find.

public

Fetch related artists

public

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

Fetch top tracks belong to an artist.

public

setArtistID(artistID: string): Artist

Init the artist object.

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

Fetch albums belong to an artist.

Params:

NameTypeAttributeDescription
limit number
  • optional

The size for one page.

offset number
  • optional

The offset index for first element.

Return:

Promise

Example:

api.artistFetcher.setArtistID('Cnv_K6i5Ft4y41SxLy').fetchAlbums();

See:

public fetchMetadata(): Promise source

Fetch metadata of the artist you find.

Return:

Promise

Example:

api.artistFetcher.setArtistID('Cnv_K6i5Ft4y41SxLy').fetchMetadata();

See:

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

Fetch related artists

Params:

NameTypeAttributeDescription
limit number
  • optional

The size for one page.

offset number
  • optional

The offset index for first element.

Return:

Promise

Example:

api.artistFetcher.setArtistID('Cnv_K6i5Ft4y41SxLy').fetchRelatedArtists();

See:

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

Fetch top tracks belong to an artist.

Params:

NameTypeAttributeDescription
limit number
  • optional

The size for one page.

offset number
  • optional

The offset index for first element.

Return:

Promise

Example:

api.artistFetcher.setArtistID('Cnv_K6i5Ft4y41SxLy').fetchTopTracks();

See:

public setArtistID(artistID: string): Artist source

Init the artist object.

Params:

NameTypeAttributeDescription
artistID string

The ID of an artist.

Return:

Artist

See: