Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.supportedInterfaces.indexOf('player') >= 0) {
this._addPlayerInterface(this._bus);
}
if (this.supportedInterfaces.indexOf('trackList') >= 0) {
this._addTracklistInterface(this._bus);
}
if (this.supportedInterfaces.indexOf('playlists') >= 0) {
this._addPlaylistsInterface(this._bus);
}
for (let k of Object.keys(this.interfaces)) {
let iface = this.interfaces[k];
this._bus.export(MPRIS_PATH, iface);
}
this._bus.requestName(this.serviceName, dbus.NameFlag.DO_NOT_QUEUE)
.then((reply) => {
if (reply === dbus.RequestNameReply.EXISTS) {
this.serviceName = `${this.serviceName}.instance${process.pid}`;
return this._bus.requestName(this.serviceName);
}
})
.catch((err) => {
this.emit('error', err);
});
};