From 10f0f6e995d5081332f3976ca7091c9c92752113 Mon Sep 17 00:00:00 2001 From: jay Date: Fri, 13 Mar 2020 01:46:03 -0300 Subject: Nuevas emisiones son informadas en chat --- bairadio.js | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'bairadio.js') diff --git a/bairadio.js b/bairadio.js index 104e2f3..df63006 100644 --- a/bairadio.js +++ b/bairadio.js @@ -1,4 +1,5 @@ var selected = ""; +var shows = []; function update(first) { var first = first || false; @@ -43,12 +44,16 @@ function update(first) { var sel = document.getElementById("server_name"); sel.textContent = ""; - var selectedPos = 0; + var currentShows = []; for (var i = -1; ++i < resp.length;) { var o = document.createElement("option"); resp[i].listenurl = resp[i].listenurl.replace("http://bienvenidoainternet.org:8000", ""); o.value = resp[i].listenurl; + if (checkNew(resp[i].listenurl) && !first) { + addMsg("Ha comenzado una nueva transmisiĆ³n: " + resp[i].server_name); + } + currentShows.push(resp[i].listenurl); o.textContent = resp[i].server_name; if (resp[i].server_description) { o.textContent += ": " + resp[i].server_description; @@ -60,6 +65,7 @@ function update(first) { sel.appendChild(o); } resp = resp[selectedPos]; + shows = currentShows; var currentListen = document.getElementById("current_server"); currentListen.value = resp.server_name; @@ -72,7 +78,7 @@ function update(first) { if (document.getElementById("chat-filter")) { filterChat(true); } } - var current = artist.textContent + title.textContent; + var currentSong = artist.textContent + title.textContent; if (resp.artist) { resp.artist = resp.artist.trim(); @@ -90,7 +96,7 @@ function update(first) { } if (title.textContent != resp.title) { var history = document.getElementById("history"); - history.innerHTML += '