Options
All
  • Public
  • Public/Protected
  • All
Menu

Spotify Playlist Class

Hierarchy

  • SpotifyPlaylist

Index

Constructors

constructor

Properties

collaborative

collaborative: boolean

Spotify Playlist collaborative boolean.

description

description: string

Spotify Playlist Description

Private fetched_tracks

fetched_tracks: <internal>.Map<string, SpotifyTrack[]>

Spotify Playlist fetched tracks Map

id

id: string

Spotify Playlist ID

name

name: string

Spotify Playlist Name

owner

Spotify Playlist Owner Artist data

Private spotifyData

spotifyData: SpotifyDataOptions

Spotify Playlist Spotify data

thumbnail

thumbnail: SpotifyThumbnail

Spotify Playlist Thumbnail Data

tracksCount

tracksCount: number

Spotify Playlist total tracks Count

type

type: "album" | "playlist" | "track"

Spotify Class type. == "playlist"

url

url: string

Spotify Playlist URL

Accessors

total_pages

  • get total_pages(): number
  • Spotify Playlist total no of pages in a playlist

    For getting all songs in a playlist,

    const playlist = await play.spotify('playlist url')

    await playlist.fetch()

    const result = []

    for (let i = 0; i <= playlist.tota_pages; i++) {
    result.push(playlist.page(i))
    }

    Returns number

total_tracks

  • get total_tracks(): number

Methods

fetch

page

  • Spotify Playlist tracks are divided in pages.

    For example getting data of 101 - 200 videos in a playlist,

    const playlist = await play.spotify('playlist url')

    await playlist.fetch()

    const result = playlist.page(2)

    Parameters

    • num: number

      Page Number

    Returns SpotifyTrack[]

toJSON

Generated using TypeDoc