mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Correct error-message on song-get on protected list
This commit is contained in:
@@ -209,7 +209,6 @@ router.route('/api/conf/:channel_name').put(function(req, res) {
|
|||||||
typeof(allvideos) != "boolean" || typeof(removeplay) != "boolean" ||
|
typeof(allvideos) != "boolean" || typeof(removeplay) != "boolean" ||
|
||||||
typeof(skipping) != "boolean" || typeof(shuffling) != "boolean" ||
|
typeof(skipping) != "boolean" || typeof(shuffling) != "boolean" ||
|
||||||
typeof(userpass_changed) != "boolean") {
|
typeof(userpass_changed) != "boolean") {
|
||||||
console.log("crash here");
|
|
||||||
throw "Wrong format";
|
throw "Wrong format";
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
@@ -532,24 +531,23 @@ router.route('/api/list/:channel_name/:video_id').get(function(req, res) {
|
|||||||
searchQuery = {now_playing: true};
|
searchQuery = {now_playing: true};
|
||||||
}
|
}
|
||||||
db.collection(channel_name).find(searchQuery, toShowChannel, function(err, docs) {
|
db.collection(channel_name).find(searchQuery, toShowChannel, function(err, docs) {
|
||||||
if(docs.length > 0) {
|
db.collection(channel_name + "_settings").find({views: {$exists: true}}, function(err, conf) {
|
||||||
db.collection(channel_name + "_settings").find({views: {$exists: true}}, function(err, conf) {
|
if(conf.length == 0) {
|
||||||
if(conf.length == 0) {
|
res.status(404).send(JSON.stringify(error.not_found.list));
|
||||||
res.status(404).send(JSON.stringify(error.not_found.list));
|
|
||||||
return;
|
|
||||||
} else if(conf[0].userpass != "" && conf[0].userpass != undefined) {
|
|
||||||
res.status(404).send(JSON.stringify(error.not_authenticated));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var to_return = error.no_error;
|
|
||||||
to_return.results = docs;
|
|
||||||
res.status(200).send(JSON.stringify(to_return));
|
|
||||||
return;
|
return;
|
||||||
});
|
} else if(conf[0].userpass != "" && conf[0].userpass != undefined) {
|
||||||
} else {
|
res.status(404).send(JSON.stringify(error.not_authenticated));
|
||||||
res.status(404).send(JSON.stringify(error.not_found.local));
|
return;
|
||||||
|
}
|
||||||
|
if(docs.length == 0) {
|
||||||
|
res.status(404).send(JSON.stringify(error.not_found.local));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var to_return = error.no_error;
|
||||||
|
to_return.results = docs;
|
||||||
|
res.status(200).send(JSON.stringify(to_return));
|
||||||
return;
|
return;
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user