mirror of
https://github.com/ppy/osu
synced 2024-12-25 00:02:48 +00:00
Remove the ability to specify a filename in ReplaceFile
This commit is contained in:
parent
448b2d1190
commit
a7e4e7be3a
@ -288,9 +288,9 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
#region Implementation of IModelFileManager<in BeatmapSetInfo,in BeatmapSetFileInfo>
|
||||
|
||||
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)
|
||||
|
@ -453,13 +453,12 @@ namespace osu.Game.Database
|
||||
/// <param name="model">The item to operate on.</param>
|
||||
/// <param name="file">The existing file to be replaced.</param>
|
||||
/// <param name="contents">The new file contents.</param>
|
||||
/// <param name="filename">An optional filename for the new file. Will use the previous filename if not specified.</param>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,8 +15,7 @@ namespace osu.Game.Database
|
||||
/// <param name="model">The item to operate on.</param>
|
||||
/// <param name="file">The existing file to be replaced.</param>
|
||||
/// <param name="contents">The new file contents.</param>
|
||||
/// <param name="filename">An optional filename for the new file. Will use the previous filename if not specified.</param>
|
||||
void ReplaceFile(TModel model, TFileModel file, Stream contents, string filename = null);
|
||||
void ReplaceFile(TModel model, TFileModel file, Stream contents);
|
||||
|
||||
/// <summary>
|
||||
/// Delete an existing file.
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user