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

MediaLibrary: Bump model to version 9

This is only a rescan, due to changes in album detection and MRL
encoding
parent 30daa980
......@@ -799,6 +799,18 @@ InitializeResult MediaLibrary::updateDatabaseModel( unsigned int previousVersion
migrateModel7to8();
previousVersion = 8;
}
if ( previousVersion == 8 )
{
// Multiple changes justify the rescan:
// - Changes in the way we chose to encode or not MRL, meaning
// potentially all MRL are wrong (more precisely, will
// mismatch what VLC expects, which makes playlist analysis
// break.
// - Fix in the way we chose album candidates, meaning some
// albums were likely to be wrongfully created.
forceRescan();
previousVersion = 9;
}
// To be continued in the future!
// Safety check: ensure we didn't forget a migration along the way
......
......@@ -32,7 +32,7 @@
namespace medialibrary
{
const uint32_t Settings::DbModelVersion = 8u;
const uint32_t Settings::DbModelVersion = 9u;
Settings::Settings( MediaLibrary* ml )
: m_ml( ml )
......
......@@ -138,8 +138,6 @@ TEST_F( DbModel, Upgrade7to8 )
LoadFakeDB( SRC_DIR "/test/unittest/db_v7.sql" );
auto res = ml->initialize( "test.db", "/tmp", cbMock.get() );
ASSERT_EQ( InitializeResult::Success, res );
// V8 adds Artist::nb_tracks and should compute the values automatically
auto a = std::static_pointer_cast<Artist>( ml->artist( 3 ) );
ASSERT_NE( nullptr, a );
ASSERT_EQ( 5u, a->nbTracks() );
// Removed post migration tests starting with V9, since we force a re-scan,
// there is no content left to test
}
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