mirror of
https://github.com/ppy/osu.git
synced 2026-05-25 12:30:17 +08:00
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()`).
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user