mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 16:43:00 +08:00
Merge pull request #21739 from integerrr/score-export-date
Append date to score export filename
This commit is contained in:
commit
cde45cdd3e
@ -33,13 +33,15 @@ namespace osu.Game.Database
|
||||
UserFileStorage = storage.GetStorageForDirectory(@"files");
|
||||
}
|
||||
|
||||
protected virtual string GetFilename(TModel item) => item.GetDisplayString();
|
||||
|
||||
/// <summary>
|
||||
/// Exports an item to a legacy (.zip based) package.
|
||||
/// </summary>
|
||||
/// <param name="item">The item to export.</param>
|
||||
public void Export(TModel item)
|
||||
{
|
||||
string itemFilename = item.GetDisplayString().GetValidFilename();
|
||||
string itemFilename = GetFilename(item).GetValidFilename();
|
||||
|
||||
IEnumerable<string> existingExports = exportStorage.GetFiles("", $"{itemFilename}*{FileExtension}");
|
||||
|
||||
|
@ -20,6 +20,14 @@ namespace osu.Game.Database
|
||||
{
|
||||
}
|
||||
|
||||
protected override string GetFilename(ScoreInfo score)
|
||||
{
|
||||
string scoreString = score.GetDisplayString();
|
||||
string filename = $"{scoreString} ({score.Date.LocalDateTime:yyyy-MM-dd_HH-mm})";
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
public override void ExportModelTo(ScoreInfo model, Stream outputStream)
|
||||
{
|
||||
var file = model.Files.SingleOrDefault();
|
||||
|
Loading…
Reference in New Issue
Block a user