diff --git a/lib/api.js b/lib/api.js index 3a20b7b2..39fc5708 100644 --- a/lib/api.js +++ b/lib/api.js @@ -34,15 +34,28 @@ module.exports = function (Server) { }; data.pagetitle = channel.opts.pagetitle; - data.media = channel.playlist.current ? - channel.playlist.current.media.pack() : - {}; + data.mediatitle = channel.playlist.current ? + channel.playlist.current.media.title : + "-"; data.usercount = channel.users.length; data.voteskip_eligible = channel.calcVoteskipMax(); data.users = []; - for(var i in channel.users) - if(channel.users[i].name !== "") - data.users.push(channel.users[i].name); + for(var i in channel.users) { + if(channel.users[i].name !== "") { + var name = channel.users[i].name; + var rank = channel.users[i].rank; + if (rank >= 255) { + name = "!" + name; + } else if (rank >= 10) { + name = "~" + name; + } else if (rank >= 3) { + name = "&" + name; + } else if (rank === 2) { + name = "@" + name; + } + data.users.push(name); + } + } data.chat = []; for(var i in channel.chatbuffer) @@ -96,7 +109,7 @@ module.exports = function (Server) { }); return; } - + if (chan !== null) { chan.getRank(uname, function (err, rank) { if (err || rank < 2) { diff --git a/www/index.html b/www/index.html index 598f2e91..ed051df7 100644 --- a/www/index.html +++ b/www/index.html @@ -94,36 +94,6 @@