Ensure all parsed "Online" IDs are above zero or null

Some .osu file sources (or database sources) may be in a bad state. We want to get these ones right as they cannot be enforced by the database itself (via FKs or constraints).
This commit is contained in:
Dean Herbert
2017-10-25 14:34:39 +09:00
parent 89cc7b7945
commit 66f1d2fb2e
3 changed files with 21 additions and 4 deletions

View File

@ -19,12 +19,23 @@ namespace osu.Game.Beatmaps
//TODO: should be in database
public int BeatmapVersion;
private int? onlineBeatmapID;
private int? onlineBeatmapSetID;
[JsonProperty("id")]
public int? OnlineBeatmapID { get; set; }
public int? OnlineBeatmapID
{
get { return onlineBeatmapID; }
set { onlineBeatmapID = value > 0 ? value : null; }
}
[JsonProperty("beatmapset_id")]
[NotMapped]
public int? OnlineBeatmapSetID { get; set; }
public int? OnlineBeatmapSetID
{
get { return onlineBeatmapSetID; }
set { onlineBeatmapSetID = value > 0 ? value : null; }
}
public int BeatmapSetInfoID { get; set; }