1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 03:25:11 +08:00

Fix previous file lookup not using metadata properties

This commit is contained in:
Salman Ahmed 2022-06-16 18:50:28 +03:00
parent f1081db953
commit 6aee689586

View File

@ -76,7 +76,7 @@ namespace osu.Game.Screens.Edit.Setup
// remove the previous background for now.
// in the future we probably want to check if this is being used elsewhere (other difficulties?)
var oldFile = set.Files.FirstOrDefault(f => Path.GetFileNameWithoutExtension(f.Filename) == destination.Name);
var oldFile = set.Files.FirstOrDefault(f => f.Filename == working.Value.Metadata.BackgroundFile);
using (var stream = source.OpenRead())
{
@ -103,7 +103,7 @@ namespace osu.Game.Screens.Edit.Setup
// remove the previous audio track for now.
// in the future we probably want to check if this is being used elsewhere (other difficulties?)
var oldFile = set.Files.FirstOrDefault(f => Path.GetFileNameWithoutExtension(f.Filename) == destination.Name);
var oldFile = set.Files.FirstOrDefault(f => f.Filename == working.Value.Metadata.AudioFile);
using (var stream = source.OpenRead())
{