mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Opening for fetching title only, and adding songs to list without being in them
This commit is contained in:
@@ -25,8 +25,6 @@ io.on('connection', function(socket){
|
||||
|
||||
var guid = hash_pass(socket.handshake.headers["user-agent"] + socket.handshake.address + socket.handshake.headers["accept-language"]).substring(0,8);
|
||||
|
||||
console.log(guid);
|
||||
|
||||
socket.on('ping', function() {
|
||||
socket.emit("ok");
|
||||
});
|
||||
@@ -103,6 +101,15 @@ io.on('connection', function(socket){
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('now_playing', function(list)
|
||||
{
|
||||
db.collection(list).find({now_playing:true}, function(err, docs)
|
||||
{
|
||||
var title = docs[0]["title"];
|
||||
socket.emit("title", title);
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('list', function(list)
|
||||
{
|
||||
if(list !== undefined && list !== null && list != "")
|
||||
@@ -209,7 +216,8 @@ io.on('connection', function(socket){
|
||||
{
|
||||
if(arr !== undefined && arr !== null && arr != "")
|
||||
{
|
||||
check_inlist(coll, guid, socket, name);
|
||||
if(arr.length == 5) coll = arr[4];
|
||||
else check_inlist(coll, guid, socket, name);
|
||||
|
||||
var id = arr[0];
|
||||
var title = arr[1];
|
||||
|
||||
Reference in New Issue
Block a user