1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 07:22:55 +08:00

More robust metadata handling.

This commit is contained in:
Huo Yaoyuan 2016-11-07 23:12:49 +08:00
parent fd977cacb3
commit ef5968e243
2 changed files with 71 additions and 69 deletions

View File

@ -70,6 +70,8 @@ namespace osu.Game.Database
return BeatmapID == other?.BeatmapID;
}
public bool AudioEquals(BeatmapInfo other) => BeatmapSet.Path == other.BeatmapSet.Path && Metadata.AudioFile == other.Metadata.AudioFile;
public bool AudioEquals(BeatmapInfo other) => other != null &&
BeatmapSet.Path == other.BeatmapSet.Path &&
(Metadata ?? BeatmapSet.Metadata).AudioFile == (other.Metadata ?? other.BeatmapSet.Metadata).AudioFile;
}
}

View File

@ -260,7 +260,7 @@ namespace osu.Game.Overlays
nextToPlay = playList[playListIndex++].Beatmaps[0];
if (playListIndex == playList.Count) playListIndex = 0;
}
while (current?.BeatmapInfo.AudioEquals(nextToPlay) == true);
while (nextToPlay.AudioEquals(current?.BeatmapInfo));
play(nextToPlay, true);
appendToHistory(nextToPlay);