]> git.sesse.net Git - casparcg/blobdiff - protocol/amcp/AMCPCommandsImpl.cpp
2.0. amcp: Fixed DATA LIST command.
[casparcg] / protocol / amcp / AMCPCommandsImpl.cpp
index c5f206ca97ae80a916a40c450fb29edf84f8be2a..bb6b11fe5d4b69bae0383e64945cdbd2357ae04d 100644 (file)
@@ -1186,7 +1186,24 @@ bool DataCommand::DoExecuteList()
 {\r
        std::wstringstream replyString;\r
        replyString << TEXT("200 DATA LIST OK\r\n");\r
-       replyString << ListMedia();\r
+\r
+       for (boost::filesystem::wrecursive_directory_iterator itr(env::data_folder()), end; itr != end; ++itr)\r
+       {                       \r
+               if(boost::filesystem::is_regular_file(itr->path()))\r
+               {\r
+                       if(!boost::iequals(itr->path().extension(), L".ftd"))\r
+                               continue;\r
+                       \r
+                       auto relativePath = boost::filesystem::wpath(itr->path().file_string().substr(env::data_folder().size()-1, itr->path().file_string().size()));\r
+                       \r
+                       auto str = relativePath.replace_extension(TEXT("")).external_file_string();\r
+                       if(str[0] == '\\' || str[0] == '/')\r
+                               str = std::wstring(str.begin() + 1, str.end());\r
+\r
+                       replyString << str << TEXT("\r\n");     \r
+               }\r
+       }\r
+       \r
        replyString << TEXT("\r\n");\r
 \r
        SetReplyString(boost::to_upper_copy(replyString.str()));\r