Added podcast support, only from subsonic API for now, ref #726

This commit is contained in:
emeric
2025-09-13 15:04:13 +02:00
parent 1d584ebcc6
commit 932e7715f5
111 changed files with 4717 additions and 188 deletions
+4 -4
View File
@@ -74,9 +74,9 @@ namespace lms::image
} // namespace
std::unique_ptr<IEncodedImage> readImage(const std::filesystem::path& path)
std::unique_ptr<IEncodedImage> readImage(const std::filesystem::path& path, std::string_view mimeType)
{
return std::make_unique<EncodedImage>(path);
return std::make_unique<EncodedImage>(path, mimeType);
}
std::unique_ptr<IEncodedImage> readImage(std::span<const std::byte> encodedData, std::string_view mimeType)
@@ -96,8 +96,8 @@ namespace lms::image
{
}
EncodedImage::EncodedImage(const std::filesystem::path& p)
: EncodedImage::EncodedImage{ fileToBuffer(p), extensionToMimeType(p.extension()) }
EncodedImage::EncodedImage(const std::filesystem::path& p, std::string_view mimeType)
: EncodedImage::EncodedImage{ fileToBuffer(p), mimeType.empty() ? extensionToMimeType(p.extension()) : mimeType }
{
}
} // namespace lms::image
+1 -1
View File
@@ -29,7 +29,7 @@ namespace lms::image
class EncodedImage : public IEncodedImage
{
public:
EncodedImage(const std::filesystem::path& path);
EncodedImage(const std::filesystem::path& path, std::string_view mimeType = "");
EncodedImage(std::vector<std::byte>&& data, std::string_view mimeType);
EncodedImage(std::span<const std::byte> data, std::string_view mimeType);
~EncodedImage() override = default;
+1 -1
View File
@@ -39,7 +39,7 @@ namespace lms::image
std::unique_ptr<IRawImage> decodeImage(const std::filesystem::path& path);
std::unique_ptr<IEncodedImage> readImage(std::span<const std::byte> encodedData, std::string_view mimeType);
std::unique_ptr<IEncodedImage> readImage(const std::filesystem::path& path);
std::unique_ptr<IEncodedImage> readImage(const std::filesystem::path& path, std::string_view mimeType = ""); // mimeType may already been known, otherwise, it is guessed based on the file extension
std::unique_ptr<IEncodedImage> encodeToJPEG(const IRawImage& rawImage, unsigned quality);
} // namespace lms::image