public void MigratePlayState(ItemRepository itemRepo) { if (SchemaVersion("play_states") != CURRENT_SCHEMA_VERSION) { //haven't migrated Logger.ReportInfo("Attempting to migrate playstates to SQL"); int cnt = 0; foreach (PlaybackStatus ps in itemRepo.AllPlayStates) { //Logger.ReportVerbose("Saving playstate for " + ps.Id); SavePlayState(ps); cnt++; } Logger.ReportInfo("Successfully migrated " + cnt + " playstate items."); //move this so we don't do it again in a shared situation itemRepo.Backup("playstate"); SetSchemaVersion("play_states", CURRENT_SCHEMA_VERSION); } }
public void MigrateDisplayPrefs(ItemRepository itemRepo) { if (SchemaVersion("display_prefs") != CURRENT_SCHEMA_VERSION) { //need to migrate Logger.ReportInfo("Attempting to migrate display preferences to SQL"); int num = displayRepo.MigrateDisplayPrefs(); Logger.ReportInfo("Migrated " + num + " display preferences."); //move this so we don't do it again in a shared situation itemRepo.Backup("display"); SetSchemaVersion("display_prefs", CURRENT_SCHEMA_VERSION); } }