mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:07:25 +08:00
Merge branch 'archive-reader' of https://github.com/tacchinotacchi/osu into archive-reader
This commit is contained in:
commit
c60353faf7
@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps.IO
|
|||||||
AddReader<OszArchiveReader>((storage, path) =>
|
AddReader<OszArchiveReader>((storage, path) =>
|
||||||
{
|
{
|
||||||
using (var stream = storage.GetStream(path))
|
using (var stream = storage.GetStream(path))
|
||||||
return ZipFile.IsZipFile(stream, false);
|
return (Path.GetExtension(path) == ".osz") && ZipFile.IsZipFile(stream, false);
|
||||||
});
|
});
|
||||||
OsuLegacyDecoder.Register();
|
OsuLegacyDecoder.Register();
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ namespace osu.Game.Database
|
|||||||
{
|
{
|
||||||
hash = input.GetMd5Hash();
|
hash = input.GetMd5Hash();
|
||||||
input.Seek(0, SeekOrigin.Begin);
|
input.Seek(0, SeekOrigin.Begin);
|
||||||
path = Path.Combine(@"beatmaps", hash.Remove(1), hash.Remove(2), hash);
|
path = Path.Combine(@"beatmaps", hash.Remove(1), hash.Remove(2), hash+".osz");
|
||||||
if (!storage.Exists(path))
|
if (!storage.Exists(path))
|
||||||
using (var output = storage.GetStream(path, FileAccess.Write))
|
using (var output = storage.GetStream(path, FileAccess.Write))
|
||||||
input.CopyTo(output);
|
input.CopyTo(output);
|
||||||
|
Loading…
Reference in New Issue
Block a user