mirror of https://github.com/calzoneman/sync.git
Add safeguard to prevent #539
This commit is contained in:
parent
54cabc04e1
commit
59468ec77c
|
@ -475,16 +475,29 @@ PlaylistModule.prototype.queueStandard = function (user, data) {
|
|||
}
|
||||
|
||||
function handleLookup() {
|
||||
var channelName = self.channel.name;
|
||||
InfoGetter.getMedia(data.id, data.type, function (err, media) {
|
||||
if (err) {
|
||||
error(XSS.sanitizeText(String(err)));
|
||||
if (self.channel && self.channel.activeLock) {
|
||||
self.channel.activeLock.release();
|
||||
} else {
|
||||
Logger.errlog.log("Attempted release of channel lock after " +
|
||||
"channel was already unloaded in queueStandard: " +
|
||||
channelName + " " + data.type + ":" + data.id);
|
||||
}
|
||||
return lock.release();
|
||||
}
|
||||
|
||||
self._addItem(media, data, user, function () {
|
||||
lock.release();
|
||||
if (self.channel && self.channel.activeLock) {
|
||||
self.channel.activeLock.release();
|
||||
} else {
|
||||
Logger.errlog.log("Attempted release of channel lock after " +
|
||||
"channel was already unloaded in queueStandard: " +
|
||||
channelName + " " + data.type + ":" + data.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue