Subsonic API: added contentType and transcodedContentType fields, fixes #363
This commit is contained in:
@@ -26,13 +26,7 @@ namespace Av
|
||||
{
|
||||
std::unique_ptr<IResourceHandler> createRawResourceHandler(const std::filesystem::path& path)
|
||||
{
|
||||
std::string mimeType;
|
||||
const auto guessedAudioFormat{ Av::guessAudioFileFormat(path) };
|
||||
if (guessedAudioFormat)
|
||||
mimeType = guessedAudioFormat->mimeType;
|
||||
else
|
||||
mimeType = "application/octet-stream";
|
||||
|
||||
return createFileResourceHandler(path, mimeType);
|
||||
std::string_view mimeType{ Av::getMimeType(path.extension()) };
|
||||
return createFileResourceHandler(path, mimeType.empty() ? "application/octet-stream" : mimeType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user