Merge branch 'master' into dev

This commit is contained in:
calzoneman 2013-08-06 20:42:01 -04:00
commit d965d0a5b6
3 changed files with 17 additions and 22 deletions

View File

@ -1215,7 +1215,6 @@ Channel.prototype.addMedia = function(data, user) {
} }
Channel.prototype.addMediaList = function(data, user) { Channel.prototype.addMediaList = function(data, user) {
var pl = data.list;
var chan = this; var chan = this;
this.playlist.addMediaList(data, function(err, item) { this.playlist.addMediaList(data, function(err, item) {
if(err) { if(err) {
@ -1226,6 +1225,8 @@ Channel.prototype.addMediaList = function(data, user) {
return; return;
} }
else { else {
item.temp = data.temp;
item.queueby = data.queueby;
chan.sendAll("queue", { chan.sendAll("queue", {
item: item.pack(), item: item.pack(),
after: item.prev ? item.prev.uid : "prepend" after: item.prev ? item.prev.uid : "prepend"
@ -1253,6 +1254,7 @@ Channel.prototype.tryQueuePlaylist = function(user, data) {
var pl = this.server.db.loadUserPlaylist(user.name, data.name); var pl = this.server.db.loadUserPlaylist(user.name, data.name);
data.list = pl; data.list = pl;
data.queueby = user.name; data.queueby = user.name;
data.temp = !this.hasPermission(user, "addnontemp");
this.addMediaList(data, user); this.addMediaList(data, user);
} }

View File

@ -283,11 +283,6 @@ Playlist.prototype.addMediaList = function(data, callback) {
var pl = this; var pl = this;
for(var i = 0; i < data.list.length; i++) { for(var i = 0; i < data.list.length; i++) {
var x = data.list[i]; var x = data.list[i];
(function(i, x) {
setTimeout(function() {
if(pl.dead)
return;
x.queueby = data.queueby;
x.pos = data.pos; x.pos = data.pos;
if(start && x == start) { if(start && x == start) {
pl.addMedia(x, function (err, item) { pl.addMedia(x, function (err, item) {
@ -304,8 +299,6 @@ Playlist.prototype.addMediaList = function(data, callback) {
else { else {
pl.addMedia(x, callback); pl.addMedia(x, callback);
} }
}, 500 * i);
})(i, x);
} }
} }

View File

@ -106,7 +106,7 @@
<div class="well well-small span12 row-fluid"> <div class="well well-small span12 row-fluid">
<div class="span12 pointer" id="librarytoggle"> <div class="span12 pointer" id="librarytoggle">
<i class="icon-plus pull-left"></i> <i class="icon-plus pull-left"></i>
<p>Show Library</p> <p>Show Library/YouTube Search</p>
</div> </div>
<div id="librarywrap"> <div id="librarywrap">
<div class="span7" id="querywrap"> <div class="span7" id="querywrap">