void OnComplete(Level level)
        {
            level.Session.BeatBestTimePlatinum(false);
            var settings = this.InRandomizerSettings;

            if (settings != null && level.Session.StartedFromBeginning) // how strong can/should we make this condition?
            {
                var hash = uint.Parse(settings.Hash);                   // convert and unconvert, yeah I know

                level.Session.BeatBestTime = false;
                if (this.SavedData.BestTimes.TryGetValue(hash, out long prevBest))
                {
                    if (level.Session.Time < prevBest)
                    {
                        level.Session.BeatBestTime     = true;
                        this.SavedData.BestTimes[hash] = level.Session.Time;
                    }
                }
                else
                {
                    this.SavedData.BestTimes[hash] = level.Session.Time;
                }

                if (settings.Rules != Ruleset.Custom)
                {
                    if (this.SavedData.BestSetSeedTimes.TryGetValue(settings.Rules, out var prevBestSet))
                    {
                        if (level.Session.Time < prevBestSet.Item1)
                        {
                            level.Session.BeatBestTimePlatinum(true);
                            this.SavedData.BestSetSeedTimes[settings.Rules] = RecordTuple.Create(level.Session.Time, settings.Seed);
                        }
                    }
                    else
                    {
                        this.SavedData.BestSetSeedTimes[settings.Rules] = RecordTuple.Create(level.Session.Time, settings.Seed);
                    }

                    if (level.Session.SeedCleanRandom())
                    {
                        if (this.SavedData.BestRandomSeedTimes.TryGetValue(settings.Rules, out var prevBestRand))
                        {
                            if (level.Session.Time < prevBestRand.Item1)
                            {
                                level.Session.BeatBestTimePlatinum(true);
                                this.SavedData.BestRandomSeedTimes[settings.Rules] = RecordTuple.Create(level.Session.Time, settings.Seed);
                            }
                        }
                        else
                        {
                            this.SavedData.BestRandomSeedTimes[settings.Rules] = RecordTuple.Create(level.Session.Time, settings.Seed);
                        }
                    }
                }

                this.SaveSettings();
            }
        }
        void OnComplete(Level level)
        {
            level.Session.BeatBestTimePlatinum(false);
            var settings = this.InRandomizerSettings;

            if (settings != null && level.Session.StartedFromBeginning) // how strong can/should we make this condition?
            {
                var hash = uint.Parse(settings.Hash);                   // convert and unconvert, yeah I know

                level.Session.BeatBestTime = false;
                if (this.SavedData.BestTimes.TryGetValue(hash, out long prevBest))
                {
                    if (level.Session.Time < prevBest)
                    {
                        level.Session.BeatBestTime     = true;
                        this.SavedData.BestTimes[hash] = level.Session.Time;
                    }
                }
                else
                {
                    this.SavedData.BestTimes[hash] = level.Session.Time;
                }

                if (settings.Rules != Ruleset.Custom)
                {
                    long submittedValue          = settings.Algorithm == LogicType.Endless ? this.CurrentScore : level.Session.Time;
                    Func <long, bool> betterthan = oldval => settings.Algorithm == LogicType.Endless ? (submittedValue > oldval) : (submittedValue < oldval);
                    if (settings.Algorithm != LogicType.Endless || settings.SeedType != SeedType.Random)
                    {
                        // unless we're playing endless, allow random seeds to count toward set seed records
                        if (this.SavedData.BestSetSeedTimes.TryGetValue(settings.Rules, out var prevBestSet))
                        {
                            if (betterthan(prevBestSet.Item1))
                            {
                                level.Session.BeatBestTimePlatinum(true);
                                this.SavedData.BestSetSeedTimes[settings.Rules] = RecordTuple.Create(submittedValue, settings.Seed);
                            }
                        }
                        else
                        {
                            this.SavedData.BestSetSeedTimes[settings.Rules] = RecordTuple.Create(submittedValue, settings.Seed);
                        }
                    }

                    if (level.Session.SeedCleanRandom())
                    {
                        if (this.SavedData.BestRandomSeedTimes.TryGetValue(settings.Rules, out var prevBestRand))
                        {
                            if (betterthan(prevBestRand.Item1))
                            {
                                level.Session.BeatBestTimePlatinum(true);
                                this.SavedData.BestRandomSeedTimes[settings.Rules] = RecordTuple.Create(submittedValue, settings.Seed);
                            }
                        }
                        else
                        {
                            this.SavedData.BestRandomSeedTimes[settings.Rules] = RecordTuple.Create(submittedValue, settings.Seed);
                        }
                    }
                }

                this.SaveSettings();
            }
        }