UNPKG

yandex-music

Version:

Creative and progressive Node.js framework for applications that interact with yandex music

40 lines (39 loc) 1.93 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.DisLikes = void 0; const log_decorator_1 = require("../../decorators/log.decorator"); const tracks_1 = require("./tracks"); class DisLikes { constructor(client) { this.client = client; this.tracks = new tracks_1.Tracks(this); } /** * Actions marked "Do not recommend". * @param {List} ids * @param {boolean} remove If True, then removes the mark, otherwise puts. * @param {number} user_id Unique user ID. * @returns OK if the request is successful. */ async action(ids, remove = false, user_id = this.client.uid) { const action = remove ? "remove" : "add-multiple"; const params = { "track-ids": ids }; return await this.client.request.post(`/users/${user_id}/dislikes/tracks/${action}`, null, params); } } __decorate([ (0, log_decorator_1.log)(), __metadata("design:type", Function), __metadata("design:paramtypes", [Array, Boolean, Number]), __metadata("design:returntype", Promise) ], DisLikes.prototype, "action", null); exports.DisLikes = DisLikes;