]> 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:49 +0000 (07:43 +0000)
committerZebiolo <Zebiolo@362d55ac-95cf-4e76-9f9a-cbaa9c17b72d>
Fri, 27 Apr 2012 07:43:49 +0000 (07:43 +0000)
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.1.0@2927 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d

protocol/amcp/AMCPCommandsImpl.cpp

index 956bab7083310421da6e8942783ac59b2fa0b12e..01567a43bb2d4c2a71732be6d3e5c7286758a7d3 100644 (file)
@@ -173,8 +173,7 @@ std::wstring ListTemplates()
                        relativePath = boost::filesystem::wpath(dir + L"/" + file);\r
                                                \r
                        auto str = relativePath.replace_extension(TEXT("")).native();\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
@@ -1329,7 +1328,7 @@ bool CinfCommand::DoExecute()
                        auto path = itr->path();\r
                        auto file = path.replace_extension(L"").filename();\r
                        if(boost::iequals(file.wstring(), _parameters.at(0)))\r
-                               info += MediaInfo(itr->path());\r
+                               info += MediaInfo(itr->path()) + L"\r\n";\r
                }\r
 \r
                if(info.empty())\r
@@ -1337,7 +1336,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