]> git.sesse.net Git - casparcg/commitdiff
Cosmetic changes and once again fixed CINF command.
authorZebiolo <Zebiolo@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Fri, 27 Apr 2012 07:43:41 +0000 (07:43 +0000)
committerZebiolo <Zebiolo@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Fri, 27 Apr 2012 07:43:41 +0000 (07:43 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/trunk@2926 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

protocol/amcp/AMCPCommandsImpl.cpp

index ce9076021b43d36056840f8e22fbfb820ebe5c7b..9ef4c5c42702de51097a89120d8ae8f67d4c41df 100644 (file)
@@ -178,8 +178,7 @@ std::wstring ListTemplates()
                        relativePath = boost::filesystem::wpath(dir + L"/" + file);\r
                                                \r
                        auto str = relativePath.replace_extension(TEXT("")).external_file_string();\r
-                       while(str.size() > 0 && (str[0] == '\\' || str[0] == '/'))\r
-                               str = std::wstring(str.begin() + 1, str.end());\r
+                       boost::trim_if(str, boost::is_any_of("\\/"));\r
 \r
                        replyString << TEXT("\"") << str\r
                                                << TEXT("\" ") << sizeWStr\r
@@ -1327,7 +1326,7 @@ bool CinfCommand::DoExecute()
                        auto path = itr->path();\r
                        auto file = path.replace_extension(L"").filename();\r
                        if(boost::iequals(file, _parameters.at(0)))\r
-                               info += MediaInfo(itr->path());\r
+                               info += MediaInfo(itr->path()) + L"\r\n";\r
                }\r
 \r
                if(info.empty())\r
@@ -1335,7 +1334,7 @@ bool CinfCommand::DoExecute()
                        SetReplyString(TEXT("404 CINF ERROR\r\n"));\r
                        return false;\r
                }\r
-               replyString << TEXT("201 CINF OK\r\n");\r
+               replyString << TEXT("200 CINF OK\r\n");\r
                replyString << info << "\r\n";\r
        }\r
        catch(...)\r