Commit 21f5b597 authored by Howl's avatar Howl
Browse files

Unrank scores done on invalid beatmaps

parent baf0b076
Loading
Loading
Loading
Loading
+18 −10
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ type config struct {
	FixScoreDuplicates            bool `description:"might take a VERY long time"`
	CalculateOverallAccuracy      bool
	FixCompletedScores            bool `description:"Set to completed = 2 all scores on beatmaps that aren't ranked."`
	UnrankScoresOnInvalidBeatmaps bool `description:"Set to completed = 2 all scores on beatmaps that are not in the database."`
	RemoveDonorOnExpired          bool
	FixMultipleCompletedScores    bool `description:"Set completed=2 if multiple completed=3 scores for same beatmap and user are present."`

@@ -125,6 +126,13 @@ func main() {
				beatmaps.ranked != '4';`)
		color.Green(" ok!")
	}
	if c.UnrankScoresOnInvalidBeatmaps {
		fmt.Print("Unranking scores on invalid beatmaps...")
		go op(`DELETE FROM scores
		LEFT JOIN beatmaps ON scores.beatmap_md5 = beatmaps.beatmap_md5
		WHERE beatmaps.beatmap_md5 IS NULL`)
		color.Green(" ok!")
	}
	if c.RemoveDonorOnExpired {
		fmt.Print("Removing donor privileges on users where donor expired...")
		go func() {