Fixed issue with some songs being added as integer ids

This commit is contained in:
Kasper Rynning-Tønnesen
2018-09-26 10:47:42 +02:00
parent 9e18b85218
commit 4e874b79fb
3 changed files with 7 additions and 4 deletions

View File

@@ -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);

View File

@@ -6,7 +6,8 @@ var Chat = {
"/login <new name> <password> to register and save a password for a nickname, or to log in with a password on a name.",
"/login <name> <new_password> <old_password> 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", "<li title='"+inp.channel+"'><span class='time_color'>" + time + "</span> " + icon_add + "<span style='color:"+color_temp+";'>"+inp.from+"</span><span class='channel-info-all-chat'> " + inp.channel + "</span></li>");
document.querySelector("#chatall").insertAdjacentHTML("beforeend", "<li title='"+Helper.decodeChannelName(inp.channel)+"'><span class='time_color'>" + time + "</span> " + icon_add + "<span style='color:"+color_temp+";'>"+inp.from+"</span><span class='channel-info-all-chat'> " + Helper.decodeChannelName(inp.channel) + "</span></li>");
var in_text = document.createTextNode(inp.msg);
document.querySelector("#chatall").children[document.querySelector("#chatall").children.length - 1].appendChild(in_text);
if(!userscroll) {

View File

@@ -1,7 +1,8 @@
<div id="donate" class="modal">
<div class="modal-content">
<h4>Donate</h4>
<p>Want to donate and support our server-bills?</p>
<p>Want to donate and support our server-bills, or get a picture of your choice besides your name in chat?</p>
<p>Just send us an email after you've donated with your username and a small picture, and we'll set you up!</p>
<p>We take all donations happily, via both PayPal, Ethereum (ETH) and Bitcoin core (BTC).</p>
<br>
<br>