]> git.sesse.net Git - casparcg/commitdiff
[AMCP] #517 Fixed bug where CINF only returned the first match
authorHelge Norberg <helge.norberg@svt.se>
Wed, 25 Jan 2017 10:31:57 +0000 (11:31 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Wed, 25 Jan 2017 10:31:57 +0000 (11:31 +0100)
CHANGELOG
protocol/amcp/AMCPCommandsImpl.cpp

index 8feb32a35b911a78fd3f9d496895b1fd59ebece4..3d54c092bc3a68197f05da59550d2b9e7a27f4cd 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -68,6 +68,7 @@ AMCP
     to know exactly what asynchronous response matched a specific request.\r
   o Added support for listing contents of a specific directory for CLS, TLS,\r
     DATA LIST and THUMBNAIL LIST.\r
+  o Fixed bug where CINF only returned the first match.\r
 \r
 \r
 \r
index 8ee1563632a26fb441e1df4dcdea41d06b80d9b9..45382b452119b6360bee81a18ec1707e99020ae6 100644 (file)
@@ -2296,15 +2296,16 @@ void cinf_describer(core::help_sink& sink, const core::help_repository& repo)
        sink.short_description(L"Get information about a media file.");
        sink.syntax(L"CINF [filename:string]");
        sink.para()->text(L"Returns information about a media file.");
+       sink.para()->text(L"If a file with the same name exist in multiple directories, all of them are returned.");
 }
 
 std::wstring cinf_command(command_context& ctx)
 {
        std::wstring info;
-       for (boost::filesystem::recursive_directory_iterator itr(env::media_folder()), end; itr != end && info.empty(); ++itr)
+       for (boost::filesystem::recursive_directory_iterator itr(env::media_folder()), end; itr != end; ++itr)
        {
                auto path = itr->path();
-               auto file = path.replace_extension(L"").filename().wstring();
+               auto file = path.stem().wstring();
                if (boost::iequals(file, ctx.parameters.at(0)))
                        info += MediaInfo(itr->path(), ctx.media_info_repo);
        }