mirror of
https://github.com/PredatH0r/ChanSort.git
synced 2026-02-02 12:39:04 +01:00
Repair damanged SQLite databases by re-indexing
This commit is contained in:
@@ -55,6 +55,7 @@ namespace ChanSort.Loader.Toshiba
|
||||
conn.Open();
|
||||
using (var cmd = conn.CreateCommand())
|
||||
{
|
||||
this.RepairCorruptedDatabaseImage(cmd);
|
||||
this.ReadSatellites(cmd);
|
||||
this.ReadTransponders(cmd);
|
||||
}
|
||||
@@ -131,6 +132,14 @@ namespace ChanSort.Loader.Toshiba
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region RepairCorruptedDatabaseImage()
|
||||
private void RepairCorruptedDatabaseImage(SQLiteCommand cmd)
|
||||
{
|
||||
cmd.CommandText = "REINDEX";
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ReadSatellites()
|
||||
private void ReadSatellites(SQLiteCommand cmd)
|
||||
{
|
||||
@@ -302,6 +311,7 @@ namespace ChanSort.Loader.Toshiba
|
||||
this.WriteChannels(cmd, "EuroSATChanList", this.satRadioChannels);
|
||||
trans.Commit();
|
||||
}
|
||||
this.RepairCorruptedDatabaseImage(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user