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

Artist: Rename artworkMrl -> thumbnailMrl

For consistency with media and album
Fix #58
parent d184990e
Pipeline #4626 passed with stage
in 5 minutes and 33 seconds
......@@ -55,7 +55,7 @@ public:
* associated thumbnail mrl will be empty.
*/
virtual bool isThumbnailGenerated() const = 0;
virtual const std::string& artworkMrl() const = 0;
virtual const std::string& thumbnailMrl() const = 0;
virtual const std::string& musicBrainzId() const = 0;
/**
* @brief nbAlbums
......
......@@ -178,7 +178,7 @@ bool Artist::isThumbnailGenerated() const
return m_thumbnailId != 0;
}
const std::string& Artist::artworkMrl() const
const std::string& Artist::thumbnailMrl() const
{
if ( m_thumbnailId == 0 )
return Thumbnail::EmptyMrl;
......
......@@ -58,9 +58,9 @@ public:
const QueryParameters* params = nullptr ) const override;
bool addMedia( Media& tracks );
virtual bool isThumbnailGenerated() const override;
virtual const std::string& artworkMrl() const override;
virtual const std::string& thumbnailMrl() const override;
std::shared_ptr<Thumbnail> thumbnail();
bool setArtworkMrl( const std::string& artworkMrl, Thumbnail::Origin origin,
bool setArtworkMrl( const std::string& thumbnailMrl, Thumbnail::Origin origin,
bool isGenerated );
bool updateNbAlbum( int increment );
bool updateNbTrack( int increment );
......
......@@ -500,7 +500,7 @@ void Tests::checkArtists(const rapidjson::Value& expectedArtists, std::vector<Ar
}
if ( expectedArtist.HasMember( "hasArtwork" ) )
{
auto artwork = artist->artworkMrl();
auto artwork = artist->thumbnailMrl();
if ( artwork.empty() == expectedArtist["hasArtwork"].GetBool() ||
artwork.compare( 0, 13, "attachment://" ) == 0 )
return false;
......
......@@ -79,19 +79,19 @@ TEST_F( Artists, ArtworkMrl )
{
auto a = ml->createArtist( "Dream seaotter" );
ASSERT_NE( a, nullptr );
ASSERT_EQ( a->artworkMrl(), "" );
ASSERT_EQ( a->thumbnailMrl(), "" );
ASSERT_FALSE( a->isThumbnailGenerated() );
std::string artwork("/tmp/otter.png");
a->setArtworkMrl( artwork, Thumbnail::Origin::UserProvided, false );
ASSERT_EQ( a->artworkMrl(), artwork );
ASSERT_EQ( a->thumbnailMrl(), artwork );
ASSERT_TRUE( a->isThumbnailGenerated() );
Reload();
auto a2 = ml->artist( a->id() );
ASSERT_NE( a2, nullptr );
ASSERT_EQ( a2->artworkMrl(), artwork );
ASSERT_EQ( a2->thumbnailMrl(), artwork );
ASSERT_TRUE( a->isThumbnailGenerated() );
}
......
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