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

Thumbnail: Rename setMrl to update

Since it will soon also allow to change the Origin field
parent 86963ad8
......@@ -64,7 +64,7 @@ const std::string& Thumbnail::mrl() const
return m_mrl;
}
bool Thumbnail::setMrl( std::string mrl )
bool Thumbnail::update( std::string mrl )
{
if ( m_mrl == mrl )
return true;
......@@ -95,7 +95,7 @@ bool Thumbnail::setMrlFromPrimaryKey( MediaLibraryPtr ml,
return false;
}
}
return thumbnail.get()->setMrl( std::move( mrl ) );
return thumbnail.get()->update( std::move( mrl ) );
}
void Thumbnail::createTable( sqlite::Connection* dbConnection )
......
......@@ -59,7 +59,7 @@ public:
int64_t id() const;
const std::string& mrl() const;
bool setMrl( std::string mrl );
bool update( std::string mrl );
Origin origin() const;
/**
......
......@@ -59,14 +59,14 @@ TEST_F( Thumbnails, MediaSetThumbnail )
ASSERT_TRUE( m->isThumbnailGenerated() );
}
TEST_F( Thumbnails, SetMrl )
TEST_F( Thumbnails, Update )
{
std::string mrl = "/path/to/thumbnail.png";
auto t = Thumbnail::create( ml.get(), mrl, Thumbnail::Origin::UserProvided );
ASSERT_EQ( t->mrl(), mrl );
mrl = "/better/thumbnail.gif";
auto res = t->setMrl( mrl );
auto res = t->update( mrl );
ASSERT_TRUE( res );
ASSERT_EQ( t->mrl(), mrl );
......
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