mirror of
https://github.com/ppy/osu.git
synced 2025-03-18 06:27:18 +08:00
Merge pull request #27586 from bdach/ignore-directory-zip-entries
Fix exports containing zero byte files after import from specific ZIP archives
This commit is contained in:
commit
5b2dd95fd6
Binary file not shown.
@ -173,6 +173,16 @@ namespace osu.Game.Tests.Skins.IO
|
||||
assertCorrectMetadata(import1, "name 1 [my custom skin 1]", "author 1", 1.0m, osu);
|
||||
});
|
||||
|
||||
[Test]
|
||||
public Task TestImportWithSubfolder() => runSkinTest(async osu =>
|
||||
{
|
||||
const string filename = "Archives/skin-with-subfolder-zip-entries.osk";
|
||||
var import = await loadSkinIntoOsu(osu, new ImportTask(TestResources.OpenResource(filename), filename));
|
||||
|
||||
assertCorrectMetadata(import, $"Totally fully features skin [Real Skin with Real Features] [{filename[..^4]}]", "Unknown", 2.7m, osu);
|
||||
Assert.That(import.PerformRead(r => r.Files.Count), Is.EqualTo(3));
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cases where imports should be uniquely imported
|
||||
|
@ -46,7 +46,7 @@ namespace osu.Game.IO.Archives
|
||||
archiveStream.Dispose();
|
||||
}
|
||||
|
||||
public override IEnumerable<string> Filenames => archive.Entries.Select(e => e.Key).ExcludeSystemFileNames();
|
||||
public override IEnumerable<string> Filenames => archive.Entries.Where(e => !e.IsDirectory).Select(e => e.Key).ExcludeSystemFileNames();
|
||||
|
||||
private class MemoryOwnerMemoryStream : Stream
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user