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

VLCMetadataService: link elements together as part of a transaction

parent 950fc162
......@@ -196,8 +196,10 @@ bool VLCMetadataService::parseAudioFile( std::shared_ptr<Media> media, VLC::Medi
LOG_WARN( "Failed to get/create associated album" );
return false;
}
return link( media, album, artists.first, artists.second );
auto t = m_dbConn->newTransaction();
auto res = link( media, album, artists.first, artists.second );
t->commit();
return res;
}
/* Album handling */
......@@ -453,7 +455,6 @@ bool VLCMetadataService::link( std::shared_ptr<Media> media, std::shared_ptr<Alb
if ( artist != nullptr && ( albumArtist == nullptr || albumArtist->id() != artist->id() ) )
artist->addMedia( media.get() );
auto currentAlbumArtist = album->albumArtist();
// If we have no main artist yet, that's easy, we need to assign one.
......
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