controlapi: whitespace cleanup; remove dup getSubdirectories()

Origin commit data
------------------
Commit: 2fd4d6c4a1
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-03-19 (Sat, 19 Mar 2016)

Origin message was:
------------------
- controlapi: whitespace cleanup; remove dup getSubdirectories()
This commit is contained in:
vanhofen
2016-03-19 10:02:40 +01:00
parent 73f6e9df2a
commit dba4d0efc5
2 changed files with 3 additions and 28 deletions

View File

@@ -3552,6 +3552,7 @@ std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path,
return result;
}
//-----------------------------------------------------------------------------
/** Get neutrino movies
*
@@ -3630,32 +3631,6 @@ void CControlAPI::getMoviesCGI(CyhookHandler *hh) {
}
}
//Helpfunction to get subdirs of a dir
std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, std::string result) {
std::string item = "";
std::string dirname;
DIR *dirp;
struct dirent *entry;
if ((dirp = opendir(path.c_str()))) {
while ((entry = readdir(dirp))) {
if (entry->d_type == DT_DIR && entry->d_name[0] != '.') {
if (path[path.length() - 1] != '/') {
path += "/";
}
std::string fullname = path + entry->d_name;
item += hh->outPair("dir", hh->outValue(fullname), false);
result += hh->outNext();
result += hh->outArrayItem("item", item, false);
item = "";
result = getSubdirectories(hh, fullname, result);
}
}
closedir(dirp);
}
return result;
}
//Helpfunction to get movies of a dir
std::string CControlAPI::readMovies(CyhookHandler *hh, std::string path, std::string result, bool subdirs) {
std::string item = "";