mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 11:37:32 +09: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");
|
UserFileStorage = storage.GetStorageForDirectory(@"files");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual string GetFilename(TModel item) => item.GetDisplayString();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Exports an item to a legacy (.zip based) package.
|
/// Exports an item to a legacy (.zip based) package.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item to export.</param>
|
/// <param name="item">The item to export.</param>
|
||||||
public void Export(TModel item)
|
public void Export(TModel item)
|
||||||
{
|
{
|
||||||
string itemFilename = item.GetDisplayString().GetValidFilename();
|
string itemFilename = GetFilename(item).GetValidFilename();
|
||||||
|
|
||||||
IEnumerable<string> existingExports = exportStorage.GetFiles("", $"{itemFilename}*{FileExtension}");
|
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)
|
public override void ExportModelTo(ScoreInfo model, Stream outputStream)
|
||||||
{
|
{
|
||||||
var file = model.Files.SingleOrDefault();
|
var file = model.Files.SingleOrDefault();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user