Fixed how the channels are sent from the server

This commit is contained in:
Kasper Rynning-Tønnesen
2016-09-23 12:31:25 +02:00
parent eebd1113c3
commit 2355bc10bc
6 changed files with 13 additions and 13 deletions

0
php/callback.html Normal file → Executable file
View File

0
static/dist/callback.min.js vendored Normal file → Executable file
View File

File diff suppressed because one or more lines are too long

0
static/js/callback.js Normal file → Executable file
View File

View File

@@ -41,7 +41,7 @@ var Nochan = {
var output = ""; var output = "";
var num = 0; var num = 0;
var pinned; var pinned;
if(lists[0][5] == 1){ if(lists[0].pinned == 1){
pinned = lists.shift(); pinned = lists.shift();
} }
lists.sort(Nochan.sortFunction); lists.sort(Nochan.sortFunction);
@@ -56,18 +56,18 @@ var Nochan = {
for(var x in lists) for(var x in lists)
{ {
var chan = lists[x][3]; var chan = lists[x].channel;
if(num<12) if(num<12)
{ {
var id = lists[x][1]; var id = lists[x].id;
var viewers = lists[x][0]; var viewers = lists[x].viewers;
var img = "background-image:url('https://img.youtube.com/vi/"+id+"/hqdefault.jpg');"; var img = "background-image:url('https://img.youtube.com/vi/"+id+"/hqdefault.jpg');";
var song_count = lists[x][4]; var song_count = lists[x].count;
//$("#channels").append(channel_list); //$("#channels").append(channel_list);
var card = pre_card; var card = pre_card;
if(lists[x][5] == 1) if(lists[x].pinned == 1)
{ {
card.find(".pin").attr("style", "display:block;"); card.find(".pin").attr("style", "display:block;");
card.find(".card").attr("title", "Pinned!"); card.find(".card").attr("title", "Pinned!");
@@ -101,11 +101,11 @@ var Nochan = {
}, },
sortFunction: function(a, b) { sortFunction: function(a, b) {
var o1 = a[0]; var o1 = a.viewers;
var o2 = b[0]; var o2 = b.viewers;
var p1 = a[4]; var p1 = a.count;
var p2 = b[4]; var p2 = b.count;
if (o1 < o2) return 1; if (o1 < o2) return 1;
if (o1 > o2) return -1; if (o1 > o2) return -1;