[UI] Better handling covers: giving browsers a chance to properly cache them

This commit is contained in:
emeric
2014-12-20 15:31:13 +01:00
parent 9ccf19a194
commit 784b73fc5a
7 changed files with 100 additions and 73 deletions
+9 -8
View File
@@ -17,11 +17,15 @@
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COVER_RESOURCE_HPP_
#define COVER_RESOURCE_HPP_
#include <boost/foreach.hpp>
#include <boost/filesystem.hpp>
#include <Wt/WResource>
#include "database/DatabaseHandler.hpp"
#include "database/AudioTypes.hpp"
namespace UserInterface {
@@ -29,8 +33,8 @@ namespace UserInterface {
class CoverResource : public Wt::WResource
{
public:
CoverResource(const boost::filesystem::path& p, // track to get cover from
std::size_t size, // size * size pixels
CoverResource(Database::Handler& db,
std::size_t size, // size * size pixels
Wt::WObject *parent = 0);
~CoverResource();
@@ -38,13 +42,10 @@ class CoverResource : public Wt::WResource
private:
boost::filesystem::path _path;
Database::Handler& _db;
std::size_t _size;
std::string _mimeType;
std::vector<unsigned char> _data;
};
} // namespace UserInterface
#endif