mirror of https://github.com/calzoneman/sync.git
Throttle comma-separated lists properly
This commit is contained in:
parent
54dee9e25d
commit
29a1f0b9d3
|
@ -1348,10 +1348,19 @@ Channel.prototype.tryQueue = function(user, data) {
|
|||
if (this.playlist.items.length === 0)
|
||||
data.list.unshift(data.list.pop());
|
||||
}
|
||||
for (var i = 0; i < data.list.length; i++) {
|
||||
data.list[i].pos = data.pos;
|
||||
this.tryQueue(user, data.list[i]);
|
||||
}
|
||||
var i = 0;
|
||||
var self = this;
|
||||
var next = function () {
|
||||
if (self.dead)
|
||||
return;
|
||||
if (i < data.list.length) {
|
||||
data.list[i].pos = data.pos;
|
||||
self.tryQueue(user, data.list[i]);
|
||||
i++;
|
||||
setTimeout(next, 2000);
|
||||
}
|
||||
};
|
||||
next();
|
||||
} else {
|
||||
this.addMedia(data, user);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue