diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index d920b194b5..8502b91096 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -288,9 +288,9 @@ namespace osu.Game.Beatmaps #region Implementation of IModelFileManager - public void ReplaceFile(BeatmapSetInfo model, BeatmapSetFileInfo file, Stream contents, string filename = null) + public void ReplaceFile(BeatmapSetInfo model, BeatmapSetFileInfo file, Stream contents) { - beatmapModelManager.ReplaceFile(model, file, contents, filename); + beatmapModelManager.ReplaceFile(model, file, contents); } public void DeleteFile(BeatmapSetInfo model, BeatmapSetFileInfo file) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index e73f4a7f6e..8cabb55cc3 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -453,13 +453,12 @@ namespace osu.Game.Database /// The item to operate on. /// The existing file to be replaced. /// The new file contents. - /// An optional filename for the new file. Will use the previous filename if not specified. - public void ReplaceFile(TModel model, TFileModel file, Stream contents, string filename = null) + public void ReplaceFile(TModel model, TFileModel file, Stream contents) { using (ContextFactory.GetForWrite()) { DeleteFile(model, file); - AddFile(model, contents, filename ?? file.Filename); + AddFile(model, contents, file.Filename); } } diff --git a/osu.Game/Database/IModelFileManager.cs b/osu.Game/Database/IModelFileManager.cs index c74b945eb7..4bc1e2d29b 100644 --- a/osu.Game/Database/IModelFileManager.cs +++ b/osu.Game/Database/IModelFileManager.cs @@ -15,8 +15,7 @@ namespace osu.Game.Database /// The item to operate on. /// The existing file to be replaced. /// The new file contents. - /// An optional filename for the new file. Will use the previous filename if not specified. - void ReplaceFile(TModel model, TFileModel file, Stream contents, string filename = null); + void ReplaceFile(TModel model, TFileModel file, Stream contents); /// /// Delete an existing file. diff --git a/osu.Game/Screens/Edit/Setup/ResourcesSection.cs b/osu.Game/Screens/Edit/Setup/ResourcesSection.cs index 8e739a786f..1e97218074 100644 --- a/osu.Game/Screens/Edit/Setup/ResourcesSection.cs +++ b/osu.Game/Screens/Edit/Setup/ResourcesSection.cs @@ -78,9 +78,9 @@ namespace osu.Game.Screens.Edit.Setup using (var stream = info.OpenRead()) { if (oldFile != null) - beatmaps.ReplaceFile(set, oldFile, stream, info.Name); - else - beatmaps.AddFile(set, stream, info.Name); + beatmaps.DeleteFile(set, oldFile); + + beatmaps.AddFile(set, stream, info.Name); } working.Value.Metadata.BackgroundFile = info.Name; @@ -105,9 +105,8 @@ namespace osu.Game.Screens.Edit.Setup using (var stream = info.OpenRead()) { if (oldFile != null) - beatmaps.ReplaceFile(set, oldFile, stream, info.Name); - else - beatmaps.AddFile(set, stream, info.Name); + beatmaps.DeleteFile(set, oldFile); + beatmaps.AddFile(set, stream, info.Name); } working.Value.Metadata.AudioFile = info.Name;