UNPKG

lunify.js

Version:

A basic api wrapper for the spotify api covering the oauth routes.

40 lines 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CurrentPlayback = void 0; const Device_1 = require("./Device"); const __1 = require("../.."); class CurrentPlayback { client; player; device; repeat; shuffle; context; timestamp; progress; playing; item; playingType; constructor(client, player, data) { this.client = client; this.player = player; this.device = new Device_1.PlayerDevice(this.client, player, data.device); this.repeat = data.repeat_state === "off" ? false : data.repeat_state; this.shuffle = data.shuffle_state; this.context = data.context ? { type: data.context.type, url: data.context.href, externalUrls: data.context.external_urls, uri: data.context.uri } : undefined; this.timestamp = data.timestamp; this.progress = data.progress_ms; this.playing = data.is_playing; if (!data.item) this.item = null; else if (data.item.type === "track") this.item = new __1.Track(client, data.item); else this.item = data.item; this.playingType = data.currently_playing_type; } } exports.CurrentPlayback = CurrentPlayback; //# sourceMappingURL=CurrentPlayback.js.map