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

VLCMetadataService: Parse release date

parent f75f44be
......@@ -104,7 +104,15 @@ bool VLCMetadataService::parseAudioFile( FilePtr file, VLC::Media& media ) const
return true;
auto album = m_ml->album( albumTitle );
if ( album == nullptr )
{
album = m_ml->createAlbum( albumTitle );
if ( album != nullptr )
{
auto date = media.meta( libvlc_meta_Date );
if ( date.length() > 0 )
album->setReleaseDate( std::stoul( date ) );
}
}
if ( album == nullptr )
{
LOG_ERROR( "Failed to create/get album" );
......
......@@ -97,6 +97,9 @@ TEST_F( VLCMetadataServices, ParseAlbum )
ASSERT_EQ( album->title(), "Boys for Pele" );
// ASSERT_NE( album->artworkUrl().length(), 0u );
auto releaseDate = album->releaseDate();
ASSERT_NE( releaseDate, 0 );
auto album2 = ml->album( "Boys for Pele" );
ASSERT_EQ( album, album2 );
}
......
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