mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
General improvements
This commit is contained in:
@ -10,6 +10,7 @@ namespace osu.Game.Beatmaps.IO
|
||||
{
|
||||
public abstract class BeatmapArchiveReader : ArchiveReader
|
||||
{
|
||||
public const string OszExtension = @".osz";
|
||||
|
||||
public static BeatmapArchiveReader GetBeatmapArchiveReader(Storage storage, string path)
|
||||
{
|
||||
@ -19,7 +20,7 @@ namespace osu.Game.Beatmaps.IO
|
||||
}
|
||||
catch (InvalidCastException e)
|
||||
{
|
||||
Logger.Error(e, "A tricky ArchiveReader instance passed the test to be a BeatmapArhiveReader, but it's really not");
|
||||
Logger.Error(e, "A tricky " + $@"{nameof(ArchiveReader)}" + " instance passed the test to be a " + $@"{nameof(BeatmapArchiveReader)}" + ", but it's really not");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Beatmaps.IO
|
||||
AddReader<OszArchiveReader>((storage, path) =>
|
||||
{
|
||||
using (var stream = storage.GetStream(path))
|
||||
return Path.GetExtension(path) == ".osz" && ZipFile.IsZipFile(stream, false);
|
||||
return Path.GetExtension(path) == OszExtension && ZipFile.IsZipFile(stream, false);
|
||||
});
|
||||
OsuLegacyDecoder.Register();
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ namespace osu.Game.Database
|
||||
{
|
||||
hash = input.GetMd5Hash();
|
||||
input.Seek(0, SeekOrigin.Begin);
|
||||
path = Path.Combine(@"beatmaps", hash.Remove(1), hash.Remove(2), hash+".osz");
|
||||
path = Path.Combine(@"beatmaps", hash.Remove(1), hash.Remove(2), hash + BeatmapArchiveReader.OszExtension);
|
||||
if (!storage.Exists(path))
|
||||
using (var output = storage.GetStream(path, FileAccess.Write))
|
||||
input.CopyTo(output);
|
||||
|
@ -327,7 +327,7 @@
|
||||
<Compile Include="Screens\Select\Options\BeatmapOptionsEditButton.cs" />
|
||||
<Compile Include="Screens\Select\Options\BeatmapOptionsOverlay.cs" />
|
||||
<Compile Include="Screens\Select\Options\BeatmapOptionsRemoveFromUnplayedButton.cs" />
|
||||
<Compile Include="Beatmaps\IO\ArchiveReader.cs" />
|
||||
<Compile Include="IO\ArchiveReader.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="$(SolutionDir)\osu-framework\osu.Framework\osu.Framework.csproj">
|
||||
|
Reference in New Issue
Block a user