1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00

Bypass optimised existing check in SkinManager (due to custom hashing function)

This commit is contained in:
Dean Herbert 2021-06-27 16:35:13 +09:00
parent e493685c14
commit 44f875b802
2 changed files with 9 additions and 1 deletions

View File

@ -309,6 +309,12 @@ namespace osu.Game.Database
Logger.Log($"{prefix} {message}", LoggingTarget.Database);
}
/// <summary>
/// Whether the implementation overrides <see cref="ComputeHash"/> with a custom implementation.
/// Custom has implementations must bypass the early exit in the import flow (see <see cref="computeHashFast"/> usage).
/// </summary>
protected virtual bool HasCustomHashFunction => false;
/// <summary>
/// Create a SHA-2 hash from the provided archive based on file content of all files matching <see cref="HashableFileTypes"/>.
/// </summary>
@ -365,7 +371,7 @@ namespace osu.Game.Database
delayEvents();
if (archive != null)
if (archive != null && !HasCustomHashFunction)
{
// fast bail to improve large import performance.
item.Hash = computeHashFast(archive);

View File

@ -125,6 +125,8 @@ namespace osu.Game.Skinning
private const string unknown_creator_string = "Unknown";
protected override bool HasCustomHashFunction => true;
protected override string ComputeHash(SkinInfo item, ArchiveReader reader = null)
{
// we need to populate early to create a hash based off skin.ini contents