1
0
Fork 0
Browse Source

removing trailing spaces for siinus

master
IngridRegina 4 years ago
parent
commit
23dbdcd441
  1. 18
      script.js

18
script.js

@ -10,10 +10,10 @@ function update(){
if (first == null) { if (first == null) {
playing = 'Mitte munnigi ei mängi prg'; playing = 'Mitte munnigi ei mängi prg';
} }
else if (first.artist != undefined) { else if (first.artist != undefined) {
playing = first.artist + ' - '; playing = first.artist + ' - ';
playing += first.title; playing += first.title;
} else { } else {
playing += first.title; playing += first.title;
} }
var nowPlaying = playing; var nowPlaying = playing;
@ -31,16 +31,16 @@ function update_field(field, data){
} }
function update_listeners(json_obj){ function update_listeners(json_obj){
var nowPlaying = getFirstPlaying(json_obj); var nowPlaying = getFirstPlaying(json_obj);
if(nowPlaying != null) { if(nowPlaying != null) {
update_field('listeners1', nowPlaying.listeners); update_field('listeners1', nowPlaying.listeners);
} }
} }
function autoupdate(){ function autoupdate(){
update(); update();
setInterval(function(){ update(); }, 30000); setInterval(function(){ update(); }, 30000);
} }
function change_bg(id){ function change_bg(id){
@ -60,9 +60,9 @@ function getFirstPlaying(jsonObj){
for(o=0; o < sources.length; o++) { for(o=0; o < sources.length; o++) {
if (sources[o].title != undefined && masterStreams.some(stream=>sources[o].listenurl.endsWith(stream))) { //check if source has a title key AND belongs to masterStreams if (sources[o].title != undefined && masterStreams.some(stream=>sources[o].listenurl.endsWith(stream))) { //check if source has a title key AND belongs to masterStreams
return sources[o]; return sources[o];
} }
} }
return null; return null;
} }

Loading…
Cancel
Save