|
@@ -67,17 +67,19 @@ JsonCommander::Response JsonCommander::executeList(const Json::Value &message) {
|
|
JsonCommander::Response response;
|
|
JsonCommander::Response response;
|
|
response.action = send;
|
|
response.action = send;
|
|
response.json["command"] = "list";
|
|
response.json["command"] = "list";
|
|
|
|
+ response.json["accept"] = true;
|
|
|
|
|
|
- Json::Value array;
|
|
|
|
|
|
+ int chunks = 0;
|
|
|
|
+ int counter = 0;
|
|
|
|
|
|
std::vector<std::string> v = fileManager.listFiles();
|
|
std::vector<std::string> v = fileManager.listFiles();
|
|
for(int i=0; i<v.size(); i++) {
|
|
for(int i=0; i<v.size(); i++) {
|
|
- array.append(v.at(i));
|
|
|
|
|
|
+ chunks += fileManager.getChunksFromFile(v.at(i));
|
|
}
|
|
}
|
|
|
|
|
|
- response.json["names"] = array;
|
|
|
|
- response.json["error"] = "";
|
|
|
|
response.json["items"] = (int) v.size();
|
|
response.json["items"] = (int) v.size();
|
|
|
|
+ response.json["chunks"] = chunks;
|
|
|
|
+ response.json["error"] = "";
|
|
|
|
|
|
return response;
|
|
return response;
|
|
}
|
|
}
|