public static bool DatabaseExists() { if (File.Exists(SqliteDataAccess.LoadDatabaseName())) { Log.Write.Info("Database exists in precheck"); DBFileExists = true; if (SqliteDataAccess.IsTableEmpty()) { Log.Write.Info("Database exists but is empty in precheck"); SqliteDataAccess.ClearTable(); return(false); } else { PostLoadUpdateTask.Start(); return(true); } } else { DBFileExists = false; return(false); } }
private static void DatabaseProcessing() { Log.Write.Info("Database update now pending"); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); Data.UpdatePending = true; SqliteDataAccess.ClearTable(); SqliteDataAccess.BuildTable(); WriteToDatabase(); Data.UpdatePending = false; stopwatch.Stop(); Log.Write.Info($"Database updated [Pending for {stopwatch.Elapsed.Seconds}.{stopwatch.Elapsed.Milliseconds} seconds]"); }