lunify.js
Version:
A basic api wrapper for the spotify api covering the oauth routes.
43 lines • 1.55 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Track = exports.PartialTrack = void 0;
const album_1 = require("../album");
const artist_1 = require("../artist");
class PartialTrack {
constructor(client, data) {
var _a;
this.client = client;
if (data.album)
this.album = new album_1.PartialAlbum(client, data.album);
this.artists = [];
for (const artist of data.artists)
this.artists.push(new artist_1.PartialArtist(client, artist));
this.markets = data.available_markets;
this.disc = data.disc_number;
this.duration = data.duration_ms;
this.explicit = data.explicit;
this.externalUrls = data.external_urls;
this.url = data.href;
this.id = data.id;
this.playable = data.is_playable;
this.linkedFrom = data.linked_from || {};
this.restrictions = ((_a = data.restrictions) === null || _a === void 0 ? void 0 : _a.reason) || null;
this.name = data.name;
this.previewUrl = data.preview_url;
this.track = data.track_number;
this.type = data.type;
this.uri = data.uri;
this.local = data.is_local;
}
}
exports.PartialTrack = PartialTrack;
class Track extends PartialTrack {
constructor(client, data) {
super(client, data);
this.client = client;
this.externalIds = data.external_ids;
this.popularity = data.popularity;
}
}
exports.Track = Track;
//# sourceMappingURL=index.js.map