@iamtraction/play-dl
    Preparing search index...

    Class DeezerTrack

    Class representing a Deezer track

    Index

    The album that this track is in

    artist: DeezerArtist

    The artist of the track

    bpm?: number

    The number of beats per minute

    undefined for partial tracks

    contributors?: DeezerArtist[]

    The artists that have contributed to the track

    undefined for partial tracks

    diskNumber?: number

    The number of the disk the track is on

    undefined for partial tracks

    durationInSec: number

    The duration of the track in seconds

    explicit: boolean

    true if the track contains any explicit lyrics

    gain?: number

    The gain of the track

    undefined for partial tracks

    id: number

    The id of the track

    partial: boolean

    Signifies that some properties are not populated

    Partial tracks can be populated by calling DeezerTrack.fetch.

    true for tracks in search results and false if the track was fetched directly or expanded.

    previewURL: string

    URL to a file containing the first 30 seconds of the track

    rank: number

    The rank of the track

    releaseDate?: Date

    The release date

    undefined for partial tracks

    shortTitle: string

    A shorter version of the title

    title: string

    The title of the track

    trackPosition?: number

    The position of the track in the album

    undefined for partial tracks

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

    The type, always 'track', useful to determine what the deezer function returned

    url: string

    The URL of the track on Deezer

    • Fetches and populates the missing fields

      The property partial will be false if this method finishes successfully.

      Returns Promise<DeezerTrack>

      A promise with the same track this method was called on.

    • Converts instances of this class to JSON data

      Returns {
          album: DeezerTrackAlbum;
          artist: DeezerArtist;
          bpm: number | undefined;
          contributors: DeezerArtist[] | undefined;
          diskNumber: number | undefined;
          durationInSec: number;
          explicit: boolean;
          gain: number | undefined;
          id: number;
          previewURL: string;
          rank: number;
          releaseDate: Date | undefined;
          shortTitle: string;
          title: string;
          trackPosition: number | undefined;
          type: "playlist" | "track" | "album";
          url: string;
      }

      JSON data.