Merge branch 'development' into LTS_development

# Conflicts:
#	src/controller/controller_streams.cpp
This commit is contained in:
Thulinma 2017-05-09 13:27:07 +02:00
commit 4f1e653c44
4 changed files with 30 additions and 0 deletions

View file

@ -213,6 +213,9 @@ void Controller::handleUDPAPI(void * np){
/// Local-only helper function that checks for duplicate protocols and removes them
static void removeDuplicateProtocols(){
JSON::Value & P = Controller::Storage["config"]["protocols"];
jsonForEach(P, it){
it->removeNullMembers();
}
std::set<std::string> ignores;
ignores.insert("online");
bool reloop = true;

View file

@ -189,10 +189,21 @@ namespace Controller {
}
/*LTS-END*/
out[jit.key()] = (*jit);
out[jit.key()].removeNullMembers();
out[jit.key()]["name"] = jit.key();
Log("STRM", std::string("Updated stream ") + jit.key());
}
}else{
std::string checked = jit.key();
Util::sanitizeName(checked);
if (checked != jit.key() || !checked.size()){
if (!checked.size()){
FAIL_MSG("Invalid stream name '%s'", jit.key().c_str());
}else{
FAIL_MSG("Invalid stream name '%s'. Suggested alternative: '%s'", jit.key().c_str(), checked.c_str());
}
continue;
}
/*LTS-START*/
if(Triggers::shouldTrigger("STREAM_ADD")){
std::string payload = jit.key()+"\n"+jit->toString();
@ -202,6 +213,7 @@ namespace Controller {
}
/*LTS-END*/
out[jit.key()] = (*jit);
out[jit.key()].removeNullMembers();
out[jit.key()]["name"] = jit.key();
Log("STRM", std::string("New stream ") + jit.key());
}