mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:53:51 +08:00
ExportAsync use TModel
This commit is contained in:
parent
405985ec5b
commit
951302fe61
@ -58,15 +58,13 @@ namespace osu.Game.Database
|
||||
/// <summary>
|
||||
/// Export the model to default folder.
|
||||
/// </summary>
|
||||
/// <param name="item">The model should export.</param>
|
||||
/// <param name="model">The model should export.</param>
|
||||
/// <returns></returns>
|
||||
public async Task ExportAsync(RealmObject item)
|
||||
{
|
||||
if (item is TModel model)
|
||||
public async Task ExportAsync(TModel model)
|
||||
{
|
||||
notifications?.Post(notification);
|
||||
|
||||
string itemFilename = item.GetDisplayString().GetValidFilename();
|
||||
string itemFilename = model.GetDisplayString().GetValidFilename();
|
||||
IEnumerable<string> existingExports = exportStorage.GetFiles("", $"{itemFilename}*{FileExtension}");
|
||||
string filename = NamingUtils.GetNextBestFilename(existingExports, $"{itemFilename}{FileExtension}");
|
||||
|
||||
@ -77,7 +75,6 @@ namespace osu.Game.Database
|
||||
await ExportToStreamAsync(model, stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Export te model corresponding to model to given stream.
|
||||
|
Loading…
Reference in New Issue
Block a user