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) {
|
||||
this._lastUpdate = Date.now();
|
||||
this._leadInterval = setInterval(this._leadLoop.bind(this), 1000);
|
||||
this._leadLoop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -720,17 +721,22 @@ PlaylistModule.prototype.handleAssignLeader = function (user, data) {
|
|||
name: old.getName(),
|
||||
rank: old.account.effectiveRank
|
||||
});
|
||||
this.channel.logger.log("[mod] " + user.getName() + " removed leader from " + old.getName());
|
||||
}
|
||||
|
||||
if (!name) {
|
||||
this.channel.broadcastAll("setLeader", "");
|
||||
|
||||
this.channel.logger.log("[playlist] Resuming autolead");
|
||||
if (!this._leadInterval) {
|
||||
this._lastUpdate = Date.now();
|
||||
this._leadInterval = setInterval(this._leadLoop.bind(this), 1000);
|
||||
}
|
||||
if (this.current !== null) {
|
||||
this.current.media.paused = false;
|
||||
|
||||
if (!this._leadInterval) {
|
||||
this._lastUpdate = Date.now();
|
||||
this._leadInterval = setInterval(this._leadLoop.bind(this), 1000);
|
||||
this._leadLoop();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue