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

tests: samples: Check for album artworks before track ones

Since the album can't have an artwork if no tracks have one.
parent efd5d4e7
...@@ -464,6 +464,14 @@ void Tests::checkAlbums( const rapidjson::Value& expectedAlbums, std::vector<Alb ...@@ -464,6 +464,14 @@ void Tests::checkAlbums( const rapidjson::Value& expectedAlbums, std::vector<Alb
return false; return false;
} }
} }
if ( expectedAlbum.HasMember( "hasArtwork" ) )
{
if ( expectedAlbum["hasArtwork"].GetBool() ==
a->thumbnailMrl( ThumbnailSizeType::Thumbnail ).empty() ||
a->thumbnailMrl( ThumbnailSizeType::Thumbnail )
.compare( 0, 13, "attachment://") == 0 )
return false;
}
if ( expectedAlbum.HasMember( "nbTracks" ) || expectedAlbum.HasMember( "tracks" ) ) if ( expectedAlbum.HasMember( "nbTracks" ) || expectedAlbum.HasMember( "tracks" ) )
{ {
const auto tracks = a->tracks( nullptr )->all(); const auto tracks = a->tracks( nullptr )->all();
...@@ -486,14 +494,6 @@ void Tests::checkAlbums( const rapidjson::Value& expectedAlbums, std::vector<Alb ...@@ -486,14 +494,6 @@ void Tests::checkAlbums( const rapidjson::Value& expectedAlbums, std::vector<Alb
if ( a->releaseYear() != releaseYear ) if ( a->releaseYear() != releaseYear )
return false; return false;
} }
if ( expectedAlbum.HasMember( "hasArtwork" ) )
{
if ( expectedAlbum["hasArtwork"].GetBool() ==
a->thumbnailMrl( ThumbnailSizeType::Thumbnail ).empty() ||
a->thumbnailMrl( ThumbnailSizeType::Thumbnail )
.compare( 0, 13, "attachment://") == 0 )
return false;
}
if ( expectedAlbum.HasMember( "nbDiscs" ) ) if ( expectedAlbum.HasMember( "nbDiscs" ) )
{ {
const auto nbDiscs = expectedAlbum["nbDiscs"].GetUint(); const auto nbDiscs = expectedAlbum["nbDiscs"].GetUint();
......
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