Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qubqub committed Nov 12, 2023
1 parent ebb3e93 commit 20d5c34
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Views/Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 20d5c34

Please sign in to comment.