spotify-now
Version:
spotify, rgb and bob.
18 lines • 943 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCurrentTrackImageUrl = void 0;
const tslib_1 = require("tslib");
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
const spotifyApi_1 = (0, tslib_1.__importDefault)(require("../spotifyApi"));
function getCurrentTrackImageUrl(currentTrackId) {
var _a;
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
const { body: { name: trackName, album: { images: trackImages }, }, } = yield spotifyApi_1.default.getTrack(currentTrackId);
const url = (_a = trackImages[0]) === null || _a === void 0 ? void 0 : _a.url;
console.log(chalk_1.default.gray("Now playing:"), trackName);
console.log(chalk_1.default.gray("Cover image url:"), url);
return url;
});
}
exports.getCurrentTrackImageUrl = getCurrentTrackImageUrl;
//# sourceMappingURL=getCurrentTrackImageUrl.js.map