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

Update to match api

This commit is contained in:
StanR 2019-08-29 12:29:31 +03:00
parent 3347ee8170
commit d303083179
4 changed files with 12 additions and 51 deletions

View File

@ -176,8 +176,8 @@ namespace osu.Game.Tests.Visual.Online
HasVideo = true, HasVideo = true,
HasStoryboard = true, HasStoryboard = true,
Covers = new BeatmapSetOnlineCovers(), Covers = new BeatmapSetOnlineCovers(),
Language = BeatmapSetOnlineLanguage.English, Language = new BeatmapSetOnlineLanguage { Id = 3, Name = "English" },
Genre = BeatmapSetOnlineGenre.Rock, Genre = new BeatmapSetOnlineGenre { Id = 4, Name = "Rock" },
}, },
Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() }, Metrics = new BeatmapSetMetrics { Ratings = Enumerable.Range(0, 11).ToArray() },
Beatmaps = new List<BeatmapInfo> Beatmaps = new List<BeatmapInfo>

View File

@ -88,55 +88,16 @@ namespace osu.Game.Beatmaps
public BeatmapSetOnlineLanguage Language { get; set; } public BeatmapSetOnlineLanguage Language { get; set; }
} }
public enum BeatmapSetOnlineGenre public class BeatmapSetOnlineGenre
{ {
[Description("Any")] public int Id { get; set; }
Any = 0, public string Name { get; set; }
[Description("Unspecified")]
Unspecified = 1,
[Description("Video Game")]
VideoGame = 2,
[Description("Anime")]
Anime = 3,
[Description("Rock")]
Rock = 4,
[Description("Pop")]
Pop = 5,
[Description("Other")]
Other = 6,
[Description("Novelty")]
Novelty = 7,
// genre_id 8 doesn't exist
[Description("Hip-Hop")]
HipHop = 9,
[Description("Electronic")]
Electronic = 10
} }
public enum BeatmapSetOnlineLanguage public class BeatmapSetOnlineLanguage
{ {
Any, public int Id { get; set; }
Other, public string Name { get; set; }
English,
Japanese,
Chinese,
Instrumental,
Korean,
French,
German,
Swedish,
Spanish,
Italian
} }
public class BeatmapSetOnlineCovers public class BeatmapSetOnlineCovers

View File

@ -69,10 +69,10 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"availability")] [JsonProperty(@"availability")]
private BeatmapSetOnlineAvailability availability { get; set; } private BeatmapSetOnlineAvailability availability { get; set; }
[JsonProperty(@"genre_id")] [JsonProperty(@"genre")]
private BeatmapSetOnlineGenre genre { get; set; } private BeatmapSetOnlineGenre genre { get; set; }
[JsonProperty(@"language_id")] [JsonProperty(@"language")]
private BeatmapSetOnlineLanguage language { get; set; } private BeatmapSetOnlineLanguage language { get; set; }
[JsonProperty(@"beatmaps")] [JsonProperty(@"beatmaps")]

View File

@ -133,8 +133,8 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
source.Text = b.NewValue?.Metadata.Source ?? string.Empty; source.Text = b.NewValue?.Metadata.Source ?? string.Empty;
tags.Text = b.NewValue?.Metadata.Tags ?? string.Empty; tags.Text = b.NewValue?.Metadata.Tags ?? string.Empty;
genre.Text = (b.NewValue?.OnlineInfo.Genre ?? BeatmapSetOnlineGenre.Unspecified).GetDescription(); genre.Text = b.NewValue?.OnlineInfo.Genre.Name ?? "Unspecified";
language.Text = (b.NewValue?.OnlineInfo.Language ?? BeatmapSetOnlineLanguage.Other).ToString(); language.Text = b.NewValue?.OnlineInfo.Language.Name ?? "Other";
}; };
} }