mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Voting now functioning better in private mode
This commit is contained in:
@@ -268,7 +268,6 @@ var List = {
|
||||
},
|
||||
|
||||
added_song: function(added){
|
||||
console.log(added);
|
||||
var now_playing;
|
||||
|
||||
if(full_playlist.length !== 0){
|
||||
@@ -396,7 +395,7 @@ var List = {
|
||||
if(!offline){
|
||||
socket.emit('vote', {channel: chan, id: id, type: vote, adminpass: adminpass});
|
||||
} else {
|
||||
List.channel_function({type:"vote", value: id, time: (new Date()).getTime()})
|
||||
List.voted_song(id, (new Date()).getTime()/1000);
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
@@ -388,10 +388,20 @@ var Search = {
|
||||
|
||||
submit: function(id,title,duration, playlist, num, full_num){
|
||||
if(offline && document.getElementsByName("addsongs")[0].checked && document.getElementsByName("addsongs")[0].disabled){
|
||||
List.channel_function({type: "added", value: {added: (new Date).getTime(), guids: [1], id: id, title: title, duration: duration, playlist: false, now_playing: false, votes: 1}});
|
||||
}
|
||||
socket.emit("add", {id: id, title: decodeURIComponent(title), adminpass: adminpass, list: chan.toLowerCase(), duration: duration, playlist: playlist, num: num, total: full_num});
|
||||
//[id, decodeURIComponent(title), adminpass, duration, playlist]);
|
||||
var found_array = [];
|
||||
found_array = $.map(full_playlist, function(obj, index) {
|
||||
if(obj.id == id) {
|
||||
return index;
|
||||
}
|
||||
});
|
||||
if(found_array.length == 0){
|
||||
List.channel_function({type: "added", value: {added: (new Date).getTime()/1000, guids: [1], id: id, title: title, duration: duration, playlist: false, now_playing: false, votes: 1}});
|
||||
} else {
|
||||
List.vote(id, "pos");
|
||||
}
|
||||
} else {
|
||||
socket.emit("add", {id: id, title: decodeURIComponent(title), adminpass: adminpass, list: chan.toLowerCase(), duration: duration, playlist: playlist, num: num, total: full_num});
|
||||
}//[id, decodeURIComponent(title), adminpass, duration, playlist]);
|
||||
},
|
||||
|
||||
durationToSeconds: function(duration) {
|
||||
|
||||
Reference in New Issue
Block a user