Fix #289
This commit is contained in:
parent
75ea06ed76
commit
89422c3c1d
3 changed files with 19 additions and 7 deletions
|
|
@ -1057,9 +1057,9 @@ Channel.prototype.broadcastNewUser = function(user) {
|
|||
// If the channel is empty and isn't registered, the first person
|
||||
// gets ownership of the channel (temporarily)
|
||||
if(self.dbloaded && self.users.length == 1 && !self.registered) {
|
||||
user.rank = (user.rank < Rank.Owner) ? 10 : user.rank;
|
||||
user.rank = (user.rank < 10) ? 10 : user.rank;
|
||||
user.socket.emit("channelNotRegistered");
|
||||
user.socket.emit("rank", 10);
|
||||
user.socket.emit("rank", user.rank);
|
||||
}
|
||||
self.server.db.listAliases(user.ip, function (err, aliases) {
|
||||
if(err) {
|
||||
|
|
@ -1432,6 +1432,15 @@ Channel.prototype.addMedia = function(data, user) {
|
|||
q.release();
|
||||
};
|
||||
|
||||
// Pre-cached data (e.g. from a playlist)
|
||||
if (typeof data.title === "string" && data.type !== "cu") {
|
||||
self.plqueue.queue(function (q) {
|
||||
var m = new Media(data.id, data.title, data.seconds, data.type);
|
||||
afterData.bind(self, q, false)(m);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// special case for youtube playlists
|
||||
if (data.type === "yp") {
|
||||
self.plqueue.queue(function (q) {
|
||||
|
|
|
|||
|
|
@ -169,12 +169,11 @@ Playlist.prototype.add = function(item, pos) {
|
|||
return "This item is already on the playlist";
|
||||
}
|
||||
|
||||
self.remove(it.uid, function () {
|
||||
self.channel.sendAll("delete", {
|
||||
uid: it.uid
|
||||
});
|
||||
self.channel.broadcastPlaylistMeta();
|
||||
self.remove(it.uid);
|
||||
self.channel.sendAll("delete", {
|
||||
uid: it.uid
|
||||
});
|
||||
self.channel.broadcastPlaylistMeta();
|
||||
}
|
||||
|
||||
if(pos == "append") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue