Fixed bad content type in case of uppercase file extension

This commit is contained in:
emeric
2023-11-20 13:29:57 +01:00
parent 6d4808d192
commit b3acdbcb89
+2 -2
View File
@@ -293,7 +293,7 @@ namespace Av
// List should be sync with the demuxers shipped in the lms's docker version
// + the _audioFileExtensions in ScanSettings
// std::filesystem::path does not seem to have std::hash specialization on freebsd
static const std::map<std::filesystem::path, std::string_view> entries
static const std::unordered_map<std::string, std::string_view> entries
{
{".mp3", "audio/mpeg"},
{".ogg", "audio/ogg"},
@@ -320,7 +320,7 @@ namespace Av
{".mka", "audio/x-matroska"},
};
auto it{ entries.find(fileExtension) };
auto it{ entries.find(StringUtils::stringToLower(fileExtension.string())) };
if (it == std::cend(entries))
return "";