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 ++++++++++++++++++++++++++------- index.html | 3 ++- 2 files changed, 28 insertions(+), 8 deletions(-) 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 += '