This commit is contained in:
calzoneman 2013-10-03 22:07:44 -05:00
parent 75ea06ed76
commit 89422c3c1d
3 changed files with 19 additions and 7 deletions

View File

@ -1,3 +1,7 @@
Thu Oct 03 22:05 2013 CDT
* lib/channel.js, lib/playlist.js: Fix 'next' bumping not properly
telling clients that the old item was deleted
Wed Oct 02 22:25 2013 CDT
* www/channel.html, www/assets/js/ui.js, www/assets/js/callbacks.js:
Add a small toggle for the MOTD

View File

@ -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) {

View File

@ -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") {