mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Trying fix for vote/add on mobile-client
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user