mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
display and hide on frontpage fix
This commit is contained in:
@@ -71,9 +71,9 @@
|
|||||||
<li><a class="setting-text">
|
<li><a class="setting-text">
|
||||||
Frontpage
|
Frontpage
|
||||||
<div class="switch"><label>
|
<div class="switch"><label>
|
||||||
Display
|
|
||||||
<input name="frontpage" type="checkbox" class="conf"><span class="lever"></span>
|
|
||||||
Hide
|
Hide
|
||||||
|
<input name="frontpage" type="checkbox" class="conf"><span class="lever"></span>
|
||||||
|
Display
|
||||||
</label></div></a></li>
|
</label></div></a></li>
|
||||||
|
|
||||||
<li><a class="setting-text">
|
<li><a class="setting-text">
|
||||||
|
|||||||
@@ -41,17 +41,19 @@ io.on('connection', function(socket){
|
|||||||
colNames.forEach(function(name){
|
colNames.forEach(function(name){
|
||||||
if(name != "system.indexes")
|
if(name != "system.indexes")
|
||||||
{
|
{
|
||||||
|
db.collection(name).find({views:{$exists:true}}, function(err, conf){
|
||||||
db.collection(name).count(function(err, num){
|
db.collection(name).count(function(err, num){
|
||||||
db.collection(name).find({now_playing:true}, function(err, np){
|
db.collection(name).find({now_playing:true}, function(err, np){
|
||||||
complete(np, i, colNames.length-2, name, num-1);
|
complete(np, i, colNames.length-2, name, num-1, conf);
|
||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
var complete = function(list, curr, tot, name, count)
|
var complete = function(list, curr, tot, name, count, conf)
|
||||||
{
|
{
|
||||||
if(list.length > 0)
|
if(list.length > 0)
|
||||||
{
|
{
|
||||||
@@ -61,6 +63,7 @@ io.on('connection', function(socket){
|
|||||||
var viewers = lists[name].length;
|
var viewers = lists[name].length;
|
||||||
}catch(err){var viewers = 0;}
|
}catch(err){var viewers = 0;}
|
||||||
var to_push = [viewers, id, title, name, count];
|
var to_push = [viewers, id, title, name, count];
|
||||||
|
if(conf[0]["frontpage"])
|
||||||
playlists_to_send.push(to_push);
|
playlists_to_send.push(to_push);
|
||||||
}
|
}
|
||||||
if(curr == tot)
|
if(curr == tot)
|
||||||
|
|||||||
Reference in New Issue
Block a user