mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-28 00:16:17 +02:00
Fix image cache
This commit is contained in:
parent
9c0c3bf0be
commit
e59f628e5f
1 changed files with 9 additions and 4 deletions
|
@ -19,14 +19,19 @@
|
||||||
#ifndef IMAGE_CACHE_HPP
|
#ifndef IMAGE_CACHE_HPP
|
||||||
#define IMAGE_CACHE_HPP
|
#define IMAGE_CACHE_HPP
|
||||||
|
|
||||||
|
|
||||||
|
// 3rd party headers
|
||||||
|
#include <boost/algorithm/hex.hpp>
|
||||||
|
#include <boost/uuid/detail/md5.hpp>
|
||||||
|
|
||||||
|
// standard headers
|
||||||
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <boost/algorithm/hex.hpp>
|
|
||||||
#include <boost/uuid/detail/md5.hpp>
|
|
||||||
|
|
||||||
|
|
||||||
class ImageCache
|
class ImageCache
|
||||||
{
|
{
|
||||||
|
@ -56,7 +61,7 @@ public:
|
||||||
ext = ext.substr(1);
|
ext = ext.substr(1);
|
||||||
filename += "." + ext;
|
filename += "." + ext;
|
||||||
std::lock_guard<std::mutex> lock(mutex_);
|
std::lock_guard<std::mutex> lock(mutex_);
|
||||||
key_to_url_[key] = std::move(filename);
|
key_to_url_[key] = filename;
|
||||||
url_to_data_[filename] = std::move(image);
|
url_to_data_[filename] = std::move(image);
|
||||||
return filename;
|
return filename;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue