mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 23:13:00 +02:00
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:
@@ -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);
|
||||
|
@@ -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);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user