1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-28 12:27:19 +08:00

Add note about expensive operation

This commit is contained in:
Dean Herbert 2024-12-10 16:44:35 +09:00
parent 3cac583754
commit bbaa542d4a
No known key found for this signature in database

View File

@ -148,16 +148,19 @@ namespace osu.Game.Screens.Edit.Setup
{
foreach (var b in otherBeatmaps)
{
if (readFilename(b.Metadata) != newFilename)
{
// This operation is quite expensive, so only perform it if required.
if (readFilename(b.Metadata) == newFilename) continue;
writeFilename(b.Metadata, newFilename);
// save the difficulty to re-encode the .osu file, updating any reference of the old filename.
//
// note that this triggers a full save flow, including triggering a difficulty calculation.
// this is not a cheap operation and should be reconsidered in the future.
var beatmapWorking = beatmaps.GetWorkingBeatmap(b);
beatmaps.Save(b, beatmapWorking.Beatmap, beatmapWorking.GetSkin());
}
}
}
writeFilename(beatmap.Metadata, newFilename);