From 8ea89b9d52a4adc653fedd81b8dba6e81aad41d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 28 Apr 2025 09:41:38 +0200 Subject: [PATCH] Fix ID3 metadata half-applying on audio file switch Should be self-explanatory (feedback loop between `reloadMetadata()` changing text box current, and text box current changing calling `applyMetadata()`). --- osu.Game/Screens/Edit/Setup/MetadataSection.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game/Screens/Edit/Setup/MetadataSection.cs b/osu.Game/Screens/Edit/Setup/MetadataSection.cs index 4e8aed8c58..288dc5cad6 100644 --- a/osu.Game/Screens/Edit/Setup/MetadataSection.cs +++ b/osu.Game/Screens/Edit/Setup/MetadataSection.cs @@ -25,6 +25,7 @@ namespace osu.Game.Screens.Edit.Setup private FormTextBox sourceTextBox = null!; private FormTextBox tagsTextBox = null!; + private bool reloading; private bool dirty; public override LocalisableString Title => EditorSetupStrings.MetadataHeader; @@ -105,6 +106,8 @@ namespace osu.Game.Screens.Edit.Setup private void reloadMetadata() { + reloading = true; + var metadata = Beatmap.Metadata; RomanisedArtistTextBox.ReadOnly = false; @@ -120,10 +123,15 @@ namespace osu.Game.Screens.Edit.Setup tagsTextBox.Current.Value = metadata.Tags; updateReadOnlyState(); + + reloading = false; } private void applyMetadata() { + if (reloading) + return; + Beatmap.Metadata.ArtistUnicode = ArtistTextBox.Current.Value; Beatmap.Metadata.Artist = RomanisedArtistTextBox.Current.Value; Beatmap.Metadata.TitleUnicode = TitleTextBox.Current.Value;