mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 01:52:55 +08:00
Fix editor saving not updating BeatmapSetInfo
's hash
This commit is contained in:
parent
0d25b63769
commit
c53dd4a703
@ -40,6 +40,8 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
|
|
||||||
SaveEditor();
|
SaveEditor();
|
||||||
|
|
||||||
|
AddAssert("Hash updated", () => !string.IsNullOrEmpty(EditorBeatmap.BeatmapInfo.BeatmapSet?.Hash));
|
||||||
|
|
||||||
AddAssert("Beatmap has correct metadata", () => EditorBeatmap.BeatmapInfo.Metadata.Artist == "artist" && EditorBeatmap.BeatmapInfo.Metadata.Title == "title");
|
AddAssert("Beatmap has correct metadata", () => EditorBeatmap.BeatmapInfo.Metadata.Artist == "artist" && EditorBeatmap.BeatmapInfo.Metadata.Title == "title");
|
||||||
AddAssert("Beatmap has correct author", () => EditorBeatmap.BeatmapInfo.Metadata.Author.Username == "author");
|
AddAssert("Beatmap has correct author", () => EditorBeatmap.BeatmapInfo.Metadata.Author.Username == "author");
|
||||||
AddAssert("Beatmap has correct difficulty name", () => EditorBeatmap.BeatmapInfo.DifficultyName == "difficulty");
|
AddAssert("Beatmap has correct difficulty name", () => EditorBeatmap.BeatmapInfo.DifficultyName == "difficulty");
|
||||||
|
@ -316,6 +316,8 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
AddFile(setInfo, stream, createBeatmapFilenameFromMetadata(beatmapInfo));
|
AddFile(setInfo, stream, createBeatmapFilenameFromMetadata(beatmapInfo));
|
||||||
|
|
||||||
|
setInfo.Hash = beatmapImporter.ComputeHash(setInfo);
|
||||||
|
|
||||||
Realm.Write(r =>
|
Realm.Write(r =>
|
||||||
{
|
{
|
||||||
var liveBeatmapSet = r.Find<BeatmapSetInfo>(setInfo.ID);
|
var liveBeatmapSet = r.Find<BeatmapSetInfo>(setInfo.ID);
|
||||||
|
@ -386,7 +386,7 @@ namespace osu.Game.Database
|
|||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// In the case of no matching files, a hash will be generated from the passed archive's <see cref="ArchiveReader.Name"/>.
|
/// In the case of no matching files, a hash will be generated from the passed archive's <see cref="ArchiveReader.Name"/>.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected string ComputeHash(TModel item)
|
public string ComputeHash(TModel item)
|
||||||
{
|
{
|
||||||
// for now, concatenate all hashable files in the set to create a unique hash.
|
// for now, concatenate all hashable files in the set to create a unique hash.
|
||||||
MemoryStream hashable = new MemoryStream();
|
MemoryStream hashable = new MemoryStream();
|
||||||
|
Loading…
Reference in New Issue
Block a user