Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions osu.Server.Queues.ScoreStatisticsProcessor.Tests/DatabaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -241,24 +242,8 @@ protected void AddBeatmapAttributes<TDifficultyAttributes>(uint? beatmapId = nul

using (var db = Processor.GetDatabaseConnection())
{
db.Execute("DELETE FROM osu_beatmap_difficulty_attribs WHERE beatmap_id = @BeatmapId AND mode = @Mode AND mods = @Mods", new
{
BeatmapId = beatmapId.Value,
Mode = mode,
Mods = modsInt
});

foreach (var a in attribs.ToDatabaseAttributes())
{
db.Insert(new BeatmapDifficultyAttribute
{
beatmap_id = beatmapId.Value,
mode = mode,
mods = modsInt,
attrib_id = (ushort)a.attributeId,
value = Convert.ToSingle(a.value),
});
}
string attribsString = string.Join(", ", attribs.ToDatabaseAttributes().Select(a => $"({beatmapId.Value}, {mode}, {modsInt}, {a.attributeId}, {a.value})"));
db.Execute($"INSERT INTO osu_beatmap_difficulty_attribs (beatmap_id, mode, mods, attrib_id, value) VALUES {attribsString} ON DUPLICATE KEY UPDATE value = VALUES(value)");
}
}

Expand Down