From 0fa135727f23d376503c4f9a2dfaa18b1cd41768 Mon Sep 17 00:00:00 2001 From: ronag Date: Fri, 19 Aug 2011 12:49:46 +0000 Subject: [PATCH] 2.0. amcp: Fixed DATA LIST command. git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1231 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- protocol/amcp/AMCPCommandsImpl.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/protocol/amcp/AMCPCommandsImpl.cpp b/protocol/amcp/AMCPCommandsImpl.cpp index c5f206ca9..bb6b11fe5 100644 --- a/protocol/amcp/AMCPCommandsImpl.cpp +++ b/protocol/amcp/AMCPCommandsImpl.cpp @@ -1186,7 +1186,24 @@ bool DataCommand::DoExecuteList() { std::wstringstream replyString; replyString << TEXT("200 DATA LIST OK\r\n"); - replyString << ListMedia(); + + for (boost::filesystem::wrecursive_directory_iterator itr(env::data_folder()), end; itr != end; ++itr) + { + if(boost::filesystem::is_regular_file(itr->path())) + { + if(!boost::iequals(itr->path().extension(), L".ftd")) + continue; + + auto relativePath = boost::filesystem::wpath(itr->path().file_string().substr(env::data_folder().size()-1, itr->path().file_string().size())); + + auto str = relativePath.replace_extension(TEXT("")).external_file_string(); + if(str[0] == '\\' || str[0] == '/') + str = std::wstring(str.begin() + 1, str.end()); + + replyString << str << TEXT("\r\n"); + } + } + replyString << TEXT("\r\n"); SetReplyString(boost::to_upper_copy(replyString.str())); -- 2.39.2