Add custom URL prefix for HTTP URLs (#1260)

Co-authored-by: Johannes Pohl <johannes.pohl@badaix.de>
This commit is contained in:
Rechner Fox 2024-07-23 12:49:15 -07:00 committed by badaix
parent 342eda02a0
commit b5284301c5
4 changed files with 18 additions and 8 deletions

View file

@ -541,7 +541,11 @@ void PcmStream::setProperties(const Properties& properties)
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;
if (server_settings_.http.url_prefix == "") {
url << "http://" << server_settings_.http.host << ":" << server_settings_.http.port << "/__image_cache?name=" << md5;
} else {
url << server_settings_.http.url_prefix << "/__image_cache?name=" << md5;
}
props.metadata->art_url = url.str();
}
else if (!props.metadata.has_value() || !props.metadata->art_data.has_value())