mirror of https://github.com/calzoneman/sync.git
Auto unpause after leader is removed
This commit is contained in:
parent
e13e695077
commit
4505ca19da
|
@ -235,6 +235,7 @@ PlaylistModule.prototype.onUserPart = function (user) {
|
||||||
if (!this._leadInterval) {
|
if (!this._leadInterval) {
|
||||||
this._lastUpdate = Date.now();
|
this._lastUpdate = Date.now();
|
||||||
this._leadInterval = setInterval(this._leadLoop.bind(this), 1000);
|
this._leadInterval = setInterval(this._leadLoop.bind(this), 1000);
|
||||||
|
this._leadLoop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -720,17 +721,22 @@ PlaylistModule.prototype.handleAssignLeader = function (user, data) {
|
||||||
name: old.getName(),
|
name: old.getName(),
|
||||||
rank: old.account.effectiveRank
|
rank: old.account.effectiveRank
|
||||||
});
|
});
|
||||||
|
this.channel.logger.log("[mod] " + user.getName() + " removed leader from " + old.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!name) {
|
if (!name) {
|
||||||
this.channel.broadcastAll("setLeader", "");
|
this.channel.broadcastAll("setLeader", "");
|
||||||
|
|
||||||
this.channel.logger.log("[playlist] Resuming autolead");
|
this.channel.logger.log("[playlist] Resuming autolead");
|
||||||
if (!this._leadInterval) {
|
if (this.current !== null) {
|
||||||
this._lastUpdate = Date.now();
|
this.current.media.paused = false;
|
||||||
this._leadInterval = setInterval(this._leadLoop.bind(this), 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (!this._leadInterval) {
|
||||||
|
this._lastUpdate = Date.now();
|
||||||
|
this._leadInterval = setInterval(this._leadLoop.bind(this), 1000);
|
||||||
|
this._leadLoop();
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue