Commit 4d510119 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

MetadataParser: Minor unknown artist handling simplification

parent e64fd886
...@@ -163,21 +163,16 @@ std::shared_ptr<Genre> MetadataParser::handleGenre( parser::Task& task ) const ...@@ -163,21 +163,16 @@ std::shared_ptr<Genre> MetadataParser::handleGenre( parser::Task& task ) const
std::shared_ptr<Album> MetadataParser::findAlbum( parser::Task& task, std::shared_ptr<Artist> albumArtist, std::shared_ptr<Album> MetadataParser::findAlbum( parser::Task& task, std::shared_ptr<Artist> albumArtist,
std::shared_ptr<Artist> trackArtist ) const std::shared_ptr<Artist> trackArtist ) const
{ {
std::shared_ptr<Album> album; if ( task.albumName.empty() == true )
std::shared_ptr<Artist> artist = albumArtist;
if ( artist == nullptr )
{
if ( trackArtist != nullptr )
artist = trackArtist;
else
{ {
artist = m_unknownArtist; std::shared_ptr<Artist> artist = albumArtist;
} if ( albumArtist != nullptr )
return albumArtist->unknownAlbum();
else if ( trackArtist != nullptr )
return trackArtist->unknownAlbum();
return m_unknownArtist->unknownAlbum();
} }
if ( task.albumName.empty() == true )
return album = artist->unknownAlbum();
// Album matching depends on the difference between artist & album artist. // Album matching depends on the difference between artist & album artist.
// Specificaly pass the albumArtist here. // Specificaly pass the albumArtist here.
static const std::string req = "SELECT * FROM " + policy::AlbumTable::Name + static const std::string req = "SELECT * FROM " + policy::AlbumTable::Name +
......
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