Trying fix for vote/add on mobile-client

This commit is contained in:
Kasper Rynning-Tønnesen
2018-03-23 18:18:24 +01:00
parent a02cdbcf88
commit c03d85b83f
3 changed files with 5 additions and 3 deletions

View File

@@ -192,6 +192,7 @@ function addPlaylist(arr, guid, offline, socket) {
if(!this_element.hasOwnProperty("end")) this_element.end = this_element.duration;
this_element.start = parseInt(this_element.start);
this_element.end = parseInt(this_element.end);
this_element.type = "video";
this_element.duration = parseInt(this_element.duration);
if(this_element.start > this_element.end) {
this_element.start = 0;

View File

@@ -31,6 +31,7 @@ var player_ready = false;
var viewers = 1;
var temp_user_pass = "";
var zoff_api_token = "DwpnKVkaMH2HdcpJT2YPy783SY33byF5/32rbs0+xdU=";
//var zoff_api_token = "AhmC4Yg2BhaWPZBXeoWK96DAiAVfbou8TUG2IXtD3ZQ=";
var retry_frontpage;
var chromecast_specs_sent = false;
var dragging = false;

View File

@@ -421,7 +421,7 @@ router.route('/api/list/:channel_name/:video_id').put(function(req,res) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
res.header({"Content-Type": "application/json"});
console.log("here");
try {
if(!req.body.hasOwnProperty('adminpass') || !req.body.hasOwnProperty('userpass') ||
!req.params.hasOwnProperty('channel_name') || !req.params.hasOwnProperty('video_id')) {
@@ -487,8 +487,8 @@ router.route('/api/list/:channel_name/:video_id').put(function(req,res) {
res.status(404).send(JSON.stringify(error.not_found.list));
return;
}
db.collection(channel_name).find({id: video_id, now_playing: false, type:"video"}, function(err, song) {
if(song.length == 0) {
db.collection(channel_name).find({id: video_id, now_playing: false}, function(err, song) {
if(song.length == 0 || (song.hasOwnProperty("type") && song.type == "suggested")) {
res.status(404).send(JSON.stringify(error.not_found.local));
return;
} else if(song[0].guids.indexOf(guid) > -1) {