mirror of
https://github.com/ppy/osu
synced 2024-12-28 09:52:56 +00:00
Fix skin export failing if a directory exists with the proposed filename
This commit is contained in:
parent
24961d1ac0
commit
e71dfd7555
@ -5,6 +5,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Extensions;
|
||||
using osu.Game.Utils;
|
||||
@ -43,7 +44,10 @@ namespace osu.Game.Database
|
||||
{
|
||||
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}");
|
||||
using (var stream = exportStorage.CreateFileSafely(filename))
|
||||
|
Loading…
Reference in New Issue
Block a user