mirror of https://github.com/calzoneman/sync.git
A few minor fixes
This commit is contained in:
parent
8a54000097
commit
d34301e2e2
|
@ -159,6 +159,8 @@ Channel.prototype.loadDump = function() {
|
||||||
|
|
||||||
// Old
|
// Old
|
||||||
if(data.queue) {
|
if(data.queue) {
|
||||||
|
if(data.position < 0)
|
||||||
|
data.position = 0;
|
||||||
for(var i = 0; i < data.queue.length; i++) {
|
for(var i = 0; i < data.queue.length; i++) {
|
||||||
var e = data.queue[i];
|
var e = data.queue[i];
|
||||||
var m = new Media(e.id, e.title, e.seconds, e.type);
|
var m = new Media(e.id, e.title, e.seconds, e.type);
|
||||||
|
@ -167,10 +169,11 @@ Channel.prototype.loadDump = function() {
|
||||||
: "";
|
: "";
|
||||||
p.temp = e.temp;
|
p.temp = e.temp;
|
||||||
this.playlist.items.append(p);
|
this.playlist.items.append(p);
|
||||||
|
if(i == data.position)
|
||||||
|
this.playlist.current = p;
|
||||||
}
|
}
|
||||||
this.sendAll("playlist", this.playlist.items.toArray());
|
this.sendAll("playlist", this.playlist.items.toArray());
|
||||||
this.broadcastPlaylistMeta();
|
this.broadcastPlaylistMeta();
|
||||||
this.playlist.current = this.playlist.first;
|
|
||||||
this.playlist.startPlayback();
|
this.playlist.startPlayback();
|
||||||
}
|
}
|
||||||
// Current
|
// Current
|
||||||
|
|
|
@ -360,6 +360,8 @@ Playlist.prototype.lead = function(lead) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Playlist.prototype.startPlayback = function(time) {
|
Playlist.prototype.startPlayback = function(time) {
|
||||||
|
if(!this.current || !this.current.media)
|
||||||
|
return false;
|
||||||
this.current.media.paused = false;
|
this.current.media.paused = false;
|
||||||
this.current.media.currentTime = time || -1;
|
this.current.media.currentTime = time || -1;
|
||||||
var pl = this;
|
var pl = this;
|
||||||
|
|
|
@ -35,12 +35,11 @@ function populateChannelOwners() {
|
||||||
var channels = res.fetchAllSync();
|
var channels = res.fetchAllSync();
|
||||||
channels.forEach(function(chan) {
|
channels.forEach(function(chan) {
|
||||||
chan = chan.name;
|
chan = chan.name;
|
||||||
console.log("Fixing " + chan);
|
|
||||||
query = "SELECT name FROM `chan_"+chan+"_ranks` WHERE rank>=10 ORDER BY rank";
|
query = "SELECT name FROM `chan_"+chan+"_ranks` WHERE rank>=10 ORDER BY rank";
|
||||||
res = db.querySync(query);
|
res = db.querySync(query);
|
||||||
if(!res) {
|
if(!res) {
|
||||||
console.log(db);
|
console.log(db);
|
||||||
console.log("Update failed!");
|
console.log("failed to fix "+chan);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue