Resolve merge conflict

This commit is contained in:
calzoneman 2013-08-08 18:28:10 -04:00
commit 4f6d72d6d5
6 changed files with 36 additions and 19 deletions

View File

@ -1161,6 +1161,7 @@ Channel.prototype.addMedia = function(data, user) {
return;
}
data.temp = isLive(data.type) || !this.hasPermission(user, "addnontemp");
data.queueby = user ? user.name : "";
data.maxlength = this.hasPermission(user, "exceedmaxlength") ? 0 : this.opts.maxlength;
var chan = this;
if(data.id in this.library) {
@ -1195,9 +1196,6 @@ Channel.prototype.addMedia = function(data, user) {
return;
}
data.temp = isLive(data.type) || !this.hasPermission(user, "addnontemp");
data.queueby = user ? user.name : "";
this.playlist.addMedia(data, function(err, item) {
if(err) {
if(err === true)
@ -1213,7 +1211,8 @@ Channel.prototype.addMedia = function(data, user) {
after: item.prev ? item.prev.uid : "prepend"
});
chan.broadcastPlaylistMeta();
chan.cacheMedia(item.media);
if(!item.temp)
chan.cacheMedia(item.media);
}
});
}
@ -1237,7 +1236,8 @@ Channel.prototype.addMediaList = function(data, user) {
after: item.prev ? item.prev.uid : "prepend"
});
chan.broadcastPlaylistMeta();
chan.cacheMedia(item.media);
if(!item.temp)
chan.cacheMedia(item.media);
}
});
}

View File

@ -2,7 +2,7 @@
"author": "Calvin Montgomery",
"name": "CyTube",
"description": "Online media synchronizer and chat",
"version": "2.3.0",
"version": "2.3.1",
"repository": {
"url": "http://github.com/calzoneman/sync"
},

View File

@ -6,7 +6,7 @@ var Logger = require("./logger");
var Channel = require("./channel");
var User = require("./user");
const VERSION = "2.3.0";
const VERSION = "2.3.1";
function getIP(req) {
var raw = req.connection.remoteAddress;

View File

@ -1,4 +1,5 @@
/*
return null;
The MIT License (MIT)
Copyright (c) 2013 Calvin Montgomery
@ -485,7 +486,7 @@ Callbacks = {
setChannelRank: function(data) {
var ents = $("#channelranks").data("entries");
if(typeof ents === undefined)
if(typeof ents === "undefined")
return;
for(var i = 0; i < ents.length; i++) {
if(ents[i].name == data.user) {
@ -621,7 +622,7 @@ Callbacks = {
addUser: function(data) {
var div = $("<div/>")
.addClass("userlist_item userlist-" + data.name);
.addClass("userlist_item");
var flair = $("<span/>").appendTo(div);
var nametag = $("<span/>").text(data.name).appendTo(div);
formatUserlistItem(div, data);
@ -658,15 +659,19 @@ Callbacks = {
}
}
var user = $(".userlist-" + data.name);
formatUserlistItem(user, data);
addUserDropdown(user, data);
if(USEROPTS.sort_rank)
sortUserlist();
var user = findUserlistItem(data.name);
if(user !== null) {
formatUserlistItem(user, data);
addUserDropdown(user, data);
if(USEROPTS.sort_rank)
sortUserlist();
}
},
setAFK: function (data) {
var user = $(".userlist-" + data.name);
var user = findUserlistItem(data.name);
if(user === null)
return;
user.find(".icon-time").remove();
$(user[0].children[1]).css("font-style", "");
if(data.afk) {
@ -679,7 +684,9 @@ Callbacks = {
},
userLeave: function(data) {
$(".userlist-" + data.name).remove();
var user = findUserlistItem(data.name);
if(user !== null)
user.remove();
},
drinkCount: function(count) {

View File

@ -346,7 +346,7 @@ $("#customembed_btn").click(function () {
$("#getplaylist").click(function() {
var callback = function(data) {
PLAYER.hide();
hidePlayer();
socket.listeners("playlist").splice(
socket.listeners("playlist").indexOf(callback)
);
@ -374,7 +374,7 @@ $("#getplaylist").click(function() {
$("<div/>").addClass("modal-footer").appendTo(modal);
modal.on("hidden", function() {
modal.remove();
PLAYER.unhide();
unhidePlayer();
});
modal.modal();
}

View File

@ -58,6 +58,16 @@ function formatURL(data) {
}
}
function findUserlistItem(name) {
var children = $("#userlist .userlist_item");
for(var i in children) {
var child = children[i];
if(child.children[1].innerHTML === name)
return $(child);
}
return null;
}
function formatUserlistItem(div, data) {
var name = $(div.children()[1]);
name.removeClass();
@ -152,7 +162,7 @@ function addUserDropdown(entry, data) {
.appendTo(sel);
}
}
sel.click(function () {
sel.change(function () {
socket.emit("setChannelRank", {
user: name,
rank: parseInt(sel.val())