Commit c09ff6df authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Thumbnail: Provide an empty MRL helper

To help when a const reference is needed as the return value.
parent 9a8d73ca
......@@ -264,10 +264,8 @@ std::vector<AudioTrackPtr> Media::audioTracks()
const std::string& Media::thumbnail()
{
if ( m_thumbnailId == 0 || m_thumbnailGenerated == false )
{
static const std::string empty;
return empty;
}
return Thumbnail::EmptyMrl;
auto lock = m_thumbnail.lock();
if ( m_thumbnail.isCached() == false )
{
......
......@@ -37,6 +37,8 @@ const std::string ThumbnailTable::PrimaryKeyColumn = "id_thumbnail";
int64_t Thumbnail::*const ThumbnailTable::PrimaryKey = &Thumbnail::m_id;
}
const std::string Thumbnail::EmptyMrl;
Thumbnail::Thumbnail(MediaLibraryPtr ml, sqlite::Row& row)
{
row >> m_id
......
......@@ -76,6 +76,9 @@ public:
static void createTable( sqlite::Connection* dbConnection );
static std::shared_ptr<Thumbnail> create( MediaLibraryPtr ml, std::string mrl,
Origin origin );
static const std::string EmptyMrl;
private:
MediaLibraryPtr m_ml;
int64_t m_id;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment