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:
4
public/dist/embed.min.js
vendored
4
public/dist/embed.min.js
vendored
File diff suppressed because one or more lines are too long
6
public/dist/main.min.js
vendored
6
public/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -268,7 +268,6 @@ var List = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
added_song: function(added){
|
added_song: function(added){
|
||||||
console.log(added);
|
|
||||||
var now_playing;
|
var now_playing;
|
||||||
|
|
||||||
if(full_playlist.length !== 0){
|
if(full_playlist.length !== 0){
|
||||||
@@ -396,7 +395,7 @@ var List = {
|
|||||||
if(!offline){
|
if(!offline){
|
||||||
socket.emit('vote', {channel: chan, id: id, type: vote, adminpass: adminpass});
|
socket.emit('vote', {channel: chan, id: id, type: vote, adminpass: adminpass});
|
||||||
} else {
|
} else {
|
||||||
List.channel_function({type:"vote", value: id, time: (new Date()).getTime()})
|
List.voted_song(id, (new Date()).getTime()/1000);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -388,10 +388,20 @@ var Search = {
|
|||||||
|
|
||||||
submit: function(id,title,duration, playlist, num, full_num){
|
submit: function(id,title,duration, playlist, num, full_num){
|
||||||
if(offline && document.getElementsByName("addsongs")[0].checked && document.getElementsByName("addsongs")[0].disabled){
|
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}});
|
var found_array = [];
|
||||||
}
|
found_array = $.map(full_playlist, function(obj, index) {
|
||||||
socket.emit("add", {id: id, title: decodeURIComponent(title), adminpass: adminpass, list: chan.toLowerCase(), duration: duration, playlist: playlist, num: num, total: full_num});
|
if(obj.id == id) {
|
||||||
//[id, decodeURIComponent(title), adminpass, duration, playlist]);
|
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) {
|
durationToSeconds: function(duration) {
|
||||||
|
|||||||
Reference in New Issue
Block a user