From 74d875a2e063fbf1878479d9cc7646b1d02b920a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 26 Dec 2019 18:44:31 +0900 Subject: [PATCH] Give empty archives a hash based on archive name to avoid duplicate imports --- osu.Game/Database/ArchiveModelManager.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index fd455d7cd5..45fe034a70 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -259,6 +259,9 @@ namespace osu.Game.Database /// /// Create a SHA-2 hash from the provided archive based on file content of all files matching . /// + /// + /// In the case of no matching files, a hash will be generated from the passed archive's . + /// private string computeHash(ArchiveReader reader) { // for now, concatenate all .osu files in the set to create a unique hash. @@ -270,7 +273,7 @@ namespace osu.Game.Database s.CopyTo(hashable); } - return hashable.Length > 0 ? hashable.ComputeSHA2Hash() : null; + return hashable.Length > 0 ? hashable.ComputeSHA2Hash() : reader.Name.ComputeSHA2Hash(); } ///