diff --git a/Views/Stats.cs b/Views/Stats.cs index 845cc1b8d..fb3331ac1 100644 --- a/Views/Stats.cs +++ b/Views/Stats.cs @@ -2103,7 +2103,9 @@ private void UpdateDatabaseVersion() { } if (this.CurrentSettings.Version == 60) { - this.StatsDB.DropCollection("FallalyticsPbInfo"); + if (this.StatsDB.CollectionExists("FallalyticsPbInfo")) { + this.StatsDB.DropCollection("FallalyticsPbInfo"); + } this.CurrentSettings.NotifyServerConnected = true; this.CurrentSettings.MuteNotificationSounds = false; this.CurrentSettings.Version = 61; @@ -2146,6 +2148,17 @@ where string.IsNullOrEmpty(p.ProfileName) this.CurrentSettings.Version = 65; this.SaveUserSettings(); } + + if (this.CurrentSettings.Version == 65) { + if (this.StatsDB.CollectionExists("FallalyticsPbInfo")) { + this.StatsDB.BeginTrans(); + this.FallalyticsPbLog.DeleteAll(); + this.StatsDB.Commit(); + } + this.CurrentSettings.EnableFallalyticsReporting = true; + this.CurrentSettings.Version = 66; + this.SaveUserSettings(); + } } private UserSettings GetDefaultSettings() { @@ -3268,6 +3281,7 @@ private async Task FallalyticsRegisterPb(RoundInfo stat, string apiKey) { Query.EQ("PrivateLobby", false) , Query.EQ("Name", stat.Name) , Query.Not("Finish", null) + , Query.Not("ShowNameId", null) )).ToList(); RoundInfo recordInfo = existingRecords.OrderBy(r => r.Finish.Value - r.Start).FirstOrDefault();