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

VLCMetadataService: Fallback to Artist if AlbumArtist is empty

parent 8c36ec59
......@@ -201,6 +201,10 @@ bool VLCMetadataService::handleArtist( std::shared_ptr<Album> album, std::shared
auto newArtist = false;
auto albumArtistName = vlcMedia.meta( libvlc_meta_AlbumArtist );
auto artistName = vlcMedia.meta( libvlc_meta_Artist );
if ( albumArtistName.empty() == true )
albumArtistName = artistName;
if ( albumArtistName.length() > 0 )
{
auto artist = std::static_pointer_cast<Artist>( m_ml->artist( albumArtistName ) );
......@@ -224,9 +228,12 @@ bool VLCMetadataService::handleArtist( std::shared_ptr<Album> album, std::shared
}
}
else
{
std::static_pointer_cast<Artist>( m_ml->unknownArtist() )->addMedia( media.get() );
// If we get here, it means we have neither artist nor albumartist tags. We can't do much more.
return true;
}
auto artistName = vlcMedia.meta( libvlc_meta_Artist );
if ( artistName.length() > 0 )
media->setArtist( artistName );
else if ( albumArtistName.length() > 0 )
......
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