From 4e874b79fb0de284ffa35114f0a8a41a100685a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Wed, 26 Sep 2018 10:47:42 +0200 Subject: [PATCH] Fixed issue with some songs being added as integer ids --- server/handlers/list_change.js | 3 ++- server/public/assets/js/chat.js | 5 +++-- server/public/partials/donate.handlebars | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/server/handlers/list_change.js b/server/handlers/list_change.js index 4d478018..591ffb34 100644 --- a/server/handlers/list_change.js +++ b/server/handlers/list_change.js @@ -213,6 +213,7 @@ function addPlaylist(arr, guid, offline, socket) { if(!this_element.hasOwnProperty("duration") || !this_element.hasOwnProperty("id") || !this_element.hasOwnProperty("title")) { continue; } + this_element.id = this_element.id + ""; this_element.added = time; this_element.now_playing = now_playing; this_element.votes = 0; @@ -394,7 +395,7 @@ function add_function(arr, coll, guid, offline, socket) { if(docs.length > 0 && (docs[0].userpass == undefined || docs[0].userpass == "" || (arr.hasOwnProperty('pass') && docs[0].userpass == crypto.createHash('sha256').update(Functions.decrypt_string(arr.pass)).digest("base64")))) { Functions.check_inlist(coll, guid, socket, offline); - var id = arr.id; + var id = arr.id + ""; var title = arr.title; var hash = Functions.hash_pass(Functions.hash_pass(Functions.decrypt_string(arr.adminpass), true)); var duration = parseInt(arr.duration); diff --git a/server/public/assets/js/chat.js b/server/public/assets/js/chat.js index 473c8d98..5019f7ce 100755 --- a/server/public/assets/js/chat.js +++ b/server/public/assets/js/chat.js @@ -6,7 +6,8 @@ var Chat = { "/login to register and save a password for a nickname, or to log in with a password on a name.", "/login to change the password on a nickname", "/logout to logout", - "/who to see the names of the people in the channel" + "/who to see the names of the people in the channel", + "Want your own icon besides your name? If you donate to us, we'll add a picture of your choosing!" ], namechange: function(data, first, initial) { @@ -125,7 +126,7 @@ var Chat = { _time = new Date(time_sent); } var time = Helper.pad(_time.getHours()) + ":" + Helper.pad(_time.getMinutes()); - document.querySelector("#chatall").insertAdjacentHTML("beforeend", "
  • " + time + " " + icon_add + ""+inp.from+" " + inp.channel + "
  • "); + document.querySelector("#chatall").insertAdjacentHTML("beforeend", "
  • " + time + " " + icon_add + ""+inp.from+" " + Helper.decodeChannelName(inp.channel) + "
  • "); var in_text = document.createTextNode(inp.msg); document.querySelector("#chatall").children[document.querySelector("#chatall").children.length - 1].appendChild(in_text); if(!userscroll) { diff --git a/server/public/partials/donate.handlebars b/server/public/partials/donate.handlebars index 05481f10..0bb5d019 100644 --- a/server/public/partials/donate.handlebars +++ b/server/public/partials/donate.handlebars @@ -1,7 +1,8 @@