diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index c9610f635..03c165a93 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -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 = ""; @@ -3681,7 +3656,7 @@ std::string CControlAPI::readMovies(CyhookHandler *hh, std::string path, std::st result += hh->outNext(); } result += hh->outArrayItem("item", item, false); - item = ""; + item = ""; } } closedir(dirp); diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 238dc1cf8..05749b7f5 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -131,7 +131,7 @@ private: void SignalInfoCGI(CyhookHandler *hh); void getDirCGI(CyhookHandler *hh); void getMoviesCGI(CyhookHandler *hh); - std::string readMovies(CyhookHandler *hh, std::string path, std::string result, bool subdirs); + std::string readMovies(CyhookHandler *hh, std::string path, std::string result, bool subdirs); std::string getSubdirectories(CyhookHandler *hh, std::string path, std::string result);