mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 04:13:11 +08:00
Merge branch 'master' into fix-exporting-a-skin-with-too-long-file-name
This commit is contained in:
commit
fb06a77e2b
@ -6,6 +6,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Game.Extensions;
|
using osu.Game.Extensions;
|
||||||
using osu.Game.Utils;
|
using osu.Game.Utils;
|
||||||
@ -61,7 +62,10 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
string itemFilename = GetFilename(item).GetValidFilename();
|
string itemFilename = GetFilename(item).GetValidFilename();
|
||||||
|
|
||||||
IEnumerable<string> existingExports = exportStorage.GetFiles("", $"{itemFilename}*{FileExtension}");
|
IEnumerable<string> existingExports =
|
||||||
|
exportStorage
|
||||||
|
.GetFiles(string.Empty, $"{itemFilename}*{FileExtension}")
|
||||||
|
.Concat(exportStorage.GetDirectories(string.Empty));
|
||||||
|
|
||||||
string filename = NamingUtils.GetNextBestFilename(existingExports, $"{itemFilename}{FileExtension}");
|
string filename = NamingUtils.GetNextBestFilename(existingExports, $"{itemFilename}{FileExtension}");
|
||||||
using (var stream = exportStorage.CreateFileSafely(filename))
|
using (var stream = exportStorage.CreateFileSafely(filename))
|
||||||
|
Loading…
Reference in New Issue
Block a user