Remove ImageCache instance from ServerSettings

This commit is contained in:
badaix 2024-07-01 23:29:26 +02:00
parent 2530a347c2
commit 78cbd3cf5b
6 changed files with 20 additions and 12 deletions

View file

@ -20,8 +20,6 @@
// prototype/interface header file
#include "jack_stream.hpp"
#include <jack/jack.h>
// local headers
#include "common/aixlog.hpp"
#include "common/snap_exception.hpp"
@ -59,7 +57,6 @@ void float_to_s24(char* dst, jack_default_audio_sample_t* src, unsigned long nsa
while (nsamples--)
{
// float to S24 conversion
if (*src <= -1.0f)
{

View file

@ -22,7 +22,6 @@
// local headers
#include "pcm_stream.hpp"
#include <server/server_settings.hpp>
// 3rd party headers
#include <boost/asio/io_context.hpp>

View file

@ -28,6 +28,7 @@
#include "common/utils/string_utils.hpp"
#include "control_error.hpp"
#include "encoder/encoder_factory.hpp"
#include "image_cache.hpp"
// 3rd party headers
#include <boost/asio/ip/host_name.hpp>
@ -537,7 +538,7 @@ void PcmStream::setProperties(const Properties& properties)
if (props.metadata.has_value() && props.metadata->art_data.has_value() && !props.metadata->art_url.has_value())
{
auto data = base64_decode(props.metadata->art_data->data);
auto md5 = ServerSettings::Http::image_cache.setImage(getName(), std::move(data), props.metadata->art_data->extension);
auto md5 = ImageCache::instance().setImage(getName(), std::move(data), props.metadata->art_data->extension);
std::stringstream url;
url << "http://" << server_settings_.http.host << ":" << server_settings_.http.port << "/__image_cache?name=" << md5;
@ -545,7 +546,7 @@ void PcmStream::setProperties(const Properties& properties)
}
else if (!props.metadata.has_value() || !props.metadata->art_data.has_value())
{
ServerSettings::Http::image_cache.clear(getName());
ImageCache::instance().clear(getName());
}
if (props == properties_)